summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-08-24 20:49:41 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-08-24 20:49:41 +0000
commit208a30f23db0926604a338eda4ed69b5c278d2e2 (patch)
treea6b31fe54d006b5402d5dc6a3ee21dd573442116 /src/backend/parser
parent2adb6d703bd255f531fc8e33c9d6abd8d6236a0b (diff)
The patch does several things:
It adds a WITH OIDS option to the copy command, which allows dumping and loading of oids. If a copy command tried to load in an oid that is greater than its current system max oid, the system max oid is incremented. No checking is done to see if other backends are running and have cached oids. pg_dump as its first step when using the -o (oid) option, will copy in a dummy row to set the system max oid value so as rows are loaded in, they are certain to be lower than the system oid. pg_dump now creates indexes at the end to speed loading Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y25
-rw-r--r--src/backend/parser/keywords.c3
2 files changed, 17 insertions, 11 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index b5c80f971cc..96dbc55cb70 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.7 1996/08/15 07:42:29 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.8 1996/08/24 20:48:44 scrappy Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -122,14 +122,14 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr);
%type <list> queryblock, relation_name_list, OptTableElementList,
tableElementList, OptInherit, definition,
- opt_with, def_args, def_name_list, func_argtypes, oper_argtypes,
+ opt_with_func, def_args, def_name_list, func_argtypes, oper_argtypes,
OptStmtList, OptStmtBlock, opt_column_list, columnList,
exprList, sort_clause, sortby_list, index_params,
name_list, from_clause, from_list, opt_array_bounds, nest_array_bounds,
expr_list, attrs, res_target_list, res_target_list2, def_list,
opt_indirection, group_clause, groupby_list, explain_options
-%type <boolean> opt_inh_star, opt_binary, opt_instead
+%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy
%type <ival> copy_dirn, archive_type, OptArchiveType, OptArchiveLocation,
def_type, opt_direction, remove_type, opt_column, event
@@ -176,7 +176,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr);
HAVING, HEAVY, IN, INDEX, INHERITS, INSERT, INSTEAD, INTO, IS,
ISNULL, LANGUAGE, LIGHT, LISTEN, LOAD, MERGE, MOVE, NEW,
NONE, NOT, NOTHING, NOTIFY, NOTNULL,
- ON, OPERATOR, OPTION, OR, ORDER,
+ OIDS, ON, OPERATOR, OPTION, OR, ORDER,
PNULL, PRIVILEGES, PUBLIC, PURGE, P_TYPE,
RENAME, REPLACE, RETRIEVE, RETURNS, REVOKE, ROLLBACK, RULE,
SELECT, SET, SETOF, STDIN, STDOUT, STORE,
@@ -306,14 +306,15 @@ ClosePortalStmt: CLOSE opt_id
*
*****************************************************************************/
-CopyStmt: COPY opt_binary relation_name copy_dirn copy_file_name copy_delimiter
+CopyStmt: COPY opt_binary relation_name opt_with_copy copy_dirn copy_file_name copy_delimiter
{
CopyStmt *n = makeNode(CopyStmt);
n->binary = $2;
n->relname = $3;
- n->direction = $4;
- n->filename = $5;
- n->delimiter = $6;
+ n->oids = $4;
+ n->direction = $5;
+ n->filename = $6;
+ n->delimiter = $7;
$$ = (Node *)n;
}
;
@@ -338,6 +339,10 @@ opt_binary: BINARY { $$ = TRUE; }
| /*EMPTY*/ { $$ = FALSE; }
;
+opt_with_copy: WITH OIDS { $$ = TRUE; }
+ | /* EMPTY */ { $$ = FALSE; }
+ ;
+
/*
* the default copy delimiter is tab but the user can configure it
*/
@@ -725,7 +730,7 @@ RecipeStmt: EXECUTE RECIPE recipe_name
*****************************************************************************/
ProcedureStmt: CREATE FUNCTION def_name def_args
- RETURNS def_arg opt_with AS Sconst LANGUAGE Sconst
+ RETURNS def_arg opt_with_func AS Sconst LANGUAGE Sconst
{
ProcedureStmt *n = makeNode(ProcedureStmt);
n->funcname = $3;
@@ -737,7 +742,7 @@ ProcedureStmt: CREATE FUNCTION def_name def_args
$$ = (Node *)n;
};
-opt_with: WITH definition { $$ = $2; }
+opt_with_func: WITH definition { $$ = $2; }
| /* EMPTY */ { $$ = NIL; }
;
diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c
index 80a18325753..31c035d42a5 100644
--- a/src/backend/parser/keywords.c
+++ b/src/backend/parser/keywords.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.2 1996/08/06 16:43:08 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.3 1996/08/24 20:48:46 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -103,6 +103,7 @@ static ScanKeyword ScanKeywords[] = {
{ "notify", NOTIFY },
{ "notnull", NOTNULL },
{ "null", PNULL },
+ { "oids", OIDS },
{ "on", ON },
{ "operator", OPERATOR },
{ "option", OPTION },