From: Bruce Momjian Date: Mon, 12 Jun 2000 19:40:58 +0000 (+0000) Subject: Rename rule CURRENT to OLD in source tree. Add mapping for backward X-Git-Tag: REL7_1_BETA~1125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=332f0f5fc0c42d6f5599e8ab8a6754588b73edb7;p=postgresql Rename rule CURRENT to OLD in source tree. Add mapping for backward compatiblity with old rules. --- diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index f4bb18762b..cbe87b5e0e 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: view.c,v 1.42 2000/02/15 03:36:39 thomas Exp $ + * $Id: view.c,v 1.43 2000/06/12 19:40:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -189,7 +189,7 @@ DefineViewRules(char *viewName, Query *viewParse) * This update consists of adding two new entries IN THE BEGINNING * of the range table (otherwise the rule system will die a slow, * horrible and painful death, and we do not want that now, do we?) - * one for the CURRENT relation and one for the NEW one (both of + * one for the OLD relation and one for the NEW one (both of * them refer in fact to the "view" relation). * * Of course we must also increase the 'varnos' of all the Var nodes @@ -224,10 +224,10 @@ UpdateRangeTableOfViewParse(char *viewName, Query *viewParse) /* * create the 2 new range table entries and form the new range - * table... CURRENT first, then NEW.... + * table... OLD first, then NEW.... */ rt_entry1 = addRangeTableEntry(NULL, (char *) viewName, - makeAttr("*CURRENT*", NULL), + makeAttr("*OLD*", NULL), FALSE, FALSE, FALSE); rt_entry2 = addRangeTableEntry(NULL, (char *) viewName, makeAttr("*NEW*", NULL), @@ -276,7 +276,7 @@ DefineView(char *viewName, Query *viewParse) /* * The range table of 'viewParse' does not contain entries for the - * "CURRENT" and "NEW" relations. So... add them! NOTE: we make the + * "OLD" and "NEW" relations. So... add them! NOTE: we make the * update in place! After this call 'viewParse' will never be what it * used to be... */ diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 5de51410fe..dbd8faf319 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: analyze.c,v 1.146 2000/06/09 01:44:18 momjian Exp $ + * $Id: analyze.c,v 1.147 2000/06/12 19:40:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1351,7 +1351,7 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt) nothing_qry->commandType = CMD_NOTHING; addRangeTableEntry(pstate, stmt->object->relname, - makeAttr("*CURRENT*", NULL), + makeAttr("*OLD*", NULL), FALSE, FALSE, FALSE); addRangeTableEntry(pstate, stmt->object->relname, makeAttr("*NEW*", NULL), @@ -1371,11 +1371,11 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt) { /* - * NOTE: 'CURRENT' must always have a varno equal to 1 and 'NEW' + * NOTE: 'OLD' must always have a varno equal to 1 and 'NEW' * equal to 2. */ addRangeTableEntry(pstate, stmt->object->relname, - makeAttr("*CURRENT*", NULL), + makeAttr("*OLD*", NULL), FALSE, FALSE, FALSE); addRangeTableEntry(pstate, stmt->object->relname, makeAttr("*NEW*", NULL), diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 925d2ab77f..3f52e80105 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.172 2000/06/12 03:40:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.173 2000/06/12 19:40:40 momjian Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -298,7 +298,7 @@ static void doNegateFloat(Value *v); BEGIN_TRANS, BETWEEN, BOTH, BY, CASCADE, CASE, CAST, CHAR, CHARACTER, CHECK, CLOSE, COALESCE, COLLATE, COLUMN, COMMIT, - CONSTRAINT, CONSTRAINTS, CREATE, CROSS, CURRENT, CURRENT_DATE, + CONSTRAINT, CONSTRAINTS, CREATE, CROSS, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER, CURSOR, DAY_P, DEC, DECIMAL, DECLARE, DEFAULT, DELETE, DESC, DISTINCT, DOUBLE, DROP, @@ -309,7 +309,7 @@ static void doNegateFloat(Value *v); ISOLATION, JOIN, KEY, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LOCAL, MATCH, MINUTE_P, MONTH_P, NAMES, NATIONAL, NATURAL, NCHAR, NEXT, NO, NOT, NULLIF, NULL_P, NUMERIC, - OF, ON, ONLY, OPTION, OR, ORDER, OUTER_P, OVERLAPS, + OF, OLD, ON, ONLY, OPTION, OR, ORDER, OUTER_P, OVERLAPS, PARTIAL, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC, READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK, SCROLL, SECOND_P, SELECT, SESSION_USER, SET, SOME, SUBSTRING, @@ -5509,7 +5509,6 @@ ColLabel: ColId { $$ = $1; } | CONSTRAINT { $$ = "constraint"; } | COPY { $$ = "copy"; } | CROSS { $$ = "cross"; } - | CURRENT { $$ = "current"; } | CURRENT_DATE { $$ = "current_date"; } | CURRENT_TIME { $$ = "current_time"; } | CURRENT_TIMESTAMP { $$ = "current_timestamp"; } @@ -5564,6 +5563,7 @@ ColLabel: ColId { $$ = $1; } | NUMERIC { $$ = "numeric"; } | OFF { $$ = "off"; } | OFFSET { $$ = "offset"; } + | OLD { $$ = "old"; } | ON { $$ = "on"; } | ONLY { $$ = "only"; } | OR { $$ = "or"; } @@ -5601,12 +5601,12 @@ ColLabel: ColId { $$ = $1; } | WHERE { $$ = "where"; } ; -SpecialRuleRelation: CURRENT +SpecialRuleRelation: OLD { if (QueryIsRule) - $$ = "*CURRENT*"; + $$ = "*OLD*"; else - elog(ERROR,"CURRENT used in non-rule query"); + elog(ERROR,"OLD used in non-rule query"); } | NEW { diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c index f167cb3c7e..76428b969c 100644 --- a/src/backend/parser/keywords.c +++ b/src/backend/parser/keywords.c @@ -9,9 +9,9 @@ * * IDENTIFICATION <<<<<<< keywords.c - * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.76 2000/06/12 03:40:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.77 2000/06/12 19:40:41 momjian Exp $ ======= - * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.76 2000/06/12 03:40:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.77 2000/06/12 19:40:41 momjian Exp $ >>>>>>> 1.73 * *------------------------------------------------------------------------- @@ -77,6 +77,8 @@ static ScanKeyword ScanKeywords[] = { {"createdb", CREATEDB}, {"createuser", CREATEUSER}, {"cross", CROSS}, + /* for portability with old rules bjm 2000-06-12 */ + {"current", OLD}, {"current_date", CURRENT_DATE}, {"current_time", CURRENT_TIME}, {"current_timestamp", CURRENT_TIMESTAMP}, @@ -183,7 +185,7 @@ static ScanKeyword ScanKeywords[] = { {"off", OFF}, {"offset", OFFSET}, {"oids", OIDS}, - {"old", CURRENT}, + {"old", OLD}, {"on", ON}, {"only", ONLY}, {"operator", OPERATOR}, diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index c871222ab3..41065c6907 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.42 2000/06/08 22:37:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.43 2000/06/12 19:40:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -250,7 +250,7 @@ addRangeTableEntry(ParseState *pstate, if (rt_index != 0 && (!inFromCl || sublevels_up == 0)) { - if (!strcmp(ref->relname, "*CURRENT*") || !strcmp(ref->relname, "*NEW*")) + if (!strcmp(ref->relname, "*OLD*") || !strcmp(ref->relname, "*NEW*")) return (RangeTblEntry *) nth(rt_index - 1, pstate->p_rtable); elog(ERROR, "Table name '%s' specified more than once", ref->relname); } diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index 3a3a76606f..2fbf6bbb69 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.74 2000/05/30 00:49:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.75 2000/06/12 19:40:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -107,11 +107,11 @@ gatherRewriteMeta(Query *parsetree, OffsetVarNodes((Node *) info->rule_action->targetList, rt_length, 0); OffsetVarNodes(info->rule_qual, rt_length, 0); ChangeVarNodes((Node *) info->rule_action->qual, - PRS2_CURRENT_VARNO + rt_length, rt_index, 0); + PRS2_OLD_VARNO + rt_length, rt_index, 0); ChangeVarNodes((Node *) info->rule_action->targetList, - PRS2_CURRENT_VARNO + rt_length, rt_index, 0); + PRS2_OLD_VARNO + rt_length, rt_index, 0); ChangeVarNodes(info->rule_qual, - PRS2_CURRENT_VARNO + rt_length, rt_index, 0); + PRS2_OLD_VARNO + rt_length, rt_index, 0); /* * bug here about replace CURRENT -- sort of replace current is @@ -125,7 +125,7 @@ gatherRewriteMeta(Query *parsetree, result_reln = info->rule_action->resultRelation; switch (result_reln) { - case PRS2_CURRENT_VARNO: + case PRS2_OLD_VARNO: new_result_reln = rt_index; break; case PRS2_NEW_VARNO: /* XXX */ @@ -796,9 +796,9 @@ ApplyRetrieveRule(Query *parsetree, OffsetVarNodes((Node *) rule_action, rt_length, 0); ChangeVarNodes((Node *) rule_qual, - PRS2_CURRENT_VARNO + rt_length, rt_index, 0); + PRS2_OLD_VARNO + rt_length, rt_index, 0); ChangeVarNodes((Node *) rule_action, - PRS2_CURRENT_VARNO + rt_length, rt_index, 0); + PRS2_OLD_VARNO + rt_length, rt_index, 0); if (relation_level) { @@ -1061,7 +1061,7 @@ CopyAndAddQual(Query *parsetree, rtable = nconc(rtable, copyObject(rule_action->rtable)); new_tree->rtable = rtable; OffsetVarNodes(new_qual, rt_length, 0); - ChangeVarNodes(new_qual, PRS2_CURRENT_VARNO + rt_length, rt_index, 0); + ChangeVarNodes(new_qual, PRS2_OLD_VARNO + rt_length, rt_index, 0); } /* XXX -- where current doesn't work for instead nothing.... yet */ AddNotQual(new_tree, new_qual); diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index e32bf2fff5..7bee5abe28 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3,7 +3,7 @@ * out of its tuple * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.52 2000/06/10 05:17:23 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.53 2000/06/12 19:40:43 momjian Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -912,7 +912,7 @@ get_select_query_def(Query *query, deparse_context *context) /* ---------- * Now check if any of the used rangetable entries is different - * from *NEW* and *CURRENT*. If so we must provide the FROM clause + * from *NEW* and *OLD*. If so we must provide the FROM clause * later. * ---------- */ @@ -927,7 +927,7 @@ get_select_query_def(Query *query, deparse_context *context) continue; if (!strcmp(rte->ref->relname, "*NEW*")) continue; - if (!strcmp(rte->ref->relname, "*CURRENT*")) + if (!strcmp(rte->ref->relname, "*OLD*")) continue; rt_constonly = FALSE; @@ -973,7 +973,7 @@ get_select_query_def(Query *query, deparse_context *context) quote_identifier(tle->resdom->resname)); } - /* If we need other tables than *NEW* or *CURRENT* add the FROM clause */ + /* If we need other tables than *NEW* or *OLD* add the FROM clause */ if (!rt_constonly && rt_numused > 0) { sep = " FROM "; @@ -988,7 +988,7 @@ get_select_query_def(Query *query, deparse_context *context) continue; if (!strcmp(rte->ref->relname, "*NEW*")) continue; - if (!strcmp(rte->ref->relname, "*CURRENT*")) + if (!strcmp(rte->ref->relname, "*OLD*")) continue; appendStringInfo(buf, sep); @@ -1074,7 +1074,7 @@ get_insert_query_def(Query *query, deparse_context *context) List *l; /* ---------- - * We need to know if other tables than *NEW* or *CURRENT* + * We need to know if other tables than *NEW* or *OLD* * are used in the query. If not, it's an INSERT ... VALUES, * otherwise an INSERT ... SELECT. * ---------- @@ -1105,7 +1105,7 @@ get_insert_query_def(Query *query, deparse_context *context) continue; if (!strcmp(rte->ref->relname, "*NEW*")) continue; - if (!strcmp(rte->ref->relname, "*CURRENT*")) + if (!strcmp(rte->ref->relname, "*OLD*")) continue; rt_constonly = FALSE; @@ -1278,7 +1278,7 @@ get_rule_expr(Node *node, deparse_context *context) quote_identifier(rte->relname)); else if (!strcmp(rte->ref->relname, "*NEW*")) appendStringInfo(buf, "new."); - else if (!strcmp(rte->ref->relname, "*CURRENT*")) + else if (!strcmp(rte->ref->relname, "*OLD*")) appendStringInfo(buf, "old."); else appendStringInfo(buf, "%s.", diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 23b91647c2..6f675873cc 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: primnodes.h,v 1.42 2000/05/25 22:42:19 tgl Exp $ + * $Id: primnodes.h,v 1.43 2000/06/12 19:40:49 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -142,8 +142,8 @@ typedef struct Expr #define INNER 65000 #define OUTER 65001 -#define PRS2_CURRENT_VARNO 1 -#define PRS2_NEW_VARNO 2 +#define PRS2_OLD_VARNO 1 +#define PRS2_NEW_VARNO 2 typedef struct Var { diff --git a/src/include/parser/parsetree.h b/src/include/parser/parsetree.h index 3f5e09cc1d..277bc32a50 100644 --- a/src/include/parser/parsetree.h +++ b/src/include/parser/parsetree.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parsetree.h,v 1.9 2000/02/15 03:38:29 thomas Exp $ + * $Id: parsetree.h,v 1.10 2000/06/12 19:40:51 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -39,7 +39,7 @@ */ #define rt_relname(rt_entry) \ - ((!strcmp(((rt_entry)->ref->relname),"*CURRENT*") ||\ + ((!strcmp(((rt_entry)->ref->relname),"*OLD*") ||\ !strcmp(((rt_entry)->ref->relname),"*NEW*")) ? ((rt_entry)->ref->relname) : \ ((char *)(rt_entry)->relname)) diff --git a/src/interfaces/ecpg/preproc/keywords.c b/src/interfaces/ecpg/preproc/keywords.c index 75676d00e9..dd93a1c2d6 100644 --- a/src/interfaces/ecpg/preproc/keywords.c +++ b/src/interfaces/ecpg/preproc/keywords.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.27 2000/06/09 01:44:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.28 2000/06/12 19:40:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -73,6 +73,8 @@ static ScanKeyword ScanKeywords[] = { {"createdb", CREATEDB}, {"createuser", CREATEUSER}, {"cross", CROSS}, + /* for portability with old rules bjm 2000-06-12 */ + {"current", OLD}, {"current_date", CURRENT_DATE}, {"current_time", CURRENT_TIME}, {"current_timestamp", CURRENT_TIMESTAMP}, @@ -178,7 +180,7 @@ static ScanKeyword ScanKeywords[] = { {"of", OF}, {"offset", OFFSET}, {"oids", OIDS}, - {"old", CURRENT}, + {"old", OLD}, {"on", ON}, {"only", ONLY}, {"operator", OPERATOR}, diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index b09aa80c6c..d45322ac17 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -196,12 +196,12 @@ make_name(void) ISOLATION, JOIN, KEY, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LOCAL, MATCH, MINUTE_P, MONTH_P, NAMES, NATIONAL, NATURAL, NCHAR, NEXT, NO, NOT, NULLIF, NULL_P, NUMERIC, - OF, ON, ONLY, OPTION, OR, ORDER, OUTER_P, OVERLAPS, + OF, OLD, ON, ONLY, OPTION, OR, ORDER, OUTER_P, OVERLAPS, PARTIAL, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC, READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK, SCROLL, SECOND_P, SELECT, SESSION_USER, SET, SOME, SUBSTRING, TABLE, TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR, - TIMEZONE_MINUTE, TO, TRAILING, TRANSACTION, TRIM, TRUE_P, + TIMEZONE_MINUTE, TO, TRAILING, TRANSACTION, TRIM, TRUE_P, UNION, UNIQUE, UPDATE, USER, USING, VALUES, VARCHAR, VARYING, VIEW, WHEN, WHERE, WITH, WORK, YEAR_P, ZONE @@ -223,20 +223,19 @@ make_name(void) * - Todd A. Brandys 1998-01-01? */ %token ABORT_TRANS, ACCESS, AFTER, AGGREGATE, ANALYZE, - BACKWARD, BEFORE, BINARY, BIT - CACHE, CLUSTER, COMMENT, COPY, CREATEDB, CREATEUSER, CYCLE, - DATABASE, DELIMITERS, DO, - EACH, ENCODING, EXCLUSIVE, EXPLAIN, EXTEND, - FORCE, FORWARD, FUNCTION, HANDLER, - INCREMENT, INDEX, INHERITS, INSTEAD, ISNULL, - LANCOMPILER, LIMIT, LISTEN, UNLISTEN, LOAD, LOCATION, LOCK_P, - MAXVALUE, MINVALUE, MODE, MOVE, - NEW, NOCREATEDB, NOCREATEUSER, NONE, NOTHING, NOTIFY, NOTNULL, - OFFSET, OIDS, OPERATOR, PASSWORD, PROCEDURAL, - REINDEX, RENAME, RESET, RETURNS, ROW, RULE, - SEQUENCE, SERIAL, SETOF, SHARE, SHOW, START, STATEMENT, STDIN, STDOUT, SYSID - TEMP, TRUNCATE, TRUSTED, - UNDER, UNLISTEN, UNTIL, VACUUM, VALID, VERBOSE, VERSION + BACKWARD, BEFORE, BINARY, BIT, CACHE, CLUSTER, COMMENT, + COPY, CREATEDB, CREATEUSER, CYCLE, DATABASE, + DELIMITERS, DO, EACH, ENCODING, EXCLUSIVE, EXPLAIN, + EXTEND, FORCE, FORWARD, FUNCTION, HANDLER, INCREMENT, + INDEX, INHERITS, INSTEAD, ISNULL, LANCOMPILER, LIMIT, + LISTEN, UNLISTEN, LOAD, LOCATION, LOCK_P, MAXVALUE, + MINVALUE, MODE, MOVE, NEW, NOCREATEDB, NOCREATEUSER, + NONE, NOTHING, NOTIFY, NOTNULL, OFFSET, OLD, OIDS, + OPERATOR, PASSWORD, PROCEDURAL, REINDEX, RENAME, RESET, + RETURNS, ROW, RULE, SEQUENCE, SERIAL, SETOF, SHARE, + SHOW, START, STATEMENT, STDIN, STDOUT, SYSID TEMP, + TRUNCATE, TRUSTED, UNDER, UNLISTEN, UNTIL, VACUUM, + VALID, VERBOSE, VERSION /* Special keywords, not in the query language - see the "lex" file */ %token IDENT SCONST Op CSTRING CVARIABLE CPP_LINE @@ -3911,12 +3910,12 @@ ColLabel: ECPGLabelTypeName { $$ = $1; } | ECPGColLabel { $$ = $1; } ; -SpecialRuleRelation: CURRENT +SpecialRuleRelation: OLD { if (QueryIsRule) - $$ = make_str("current"); + $$ = make_str("old"); else - mmerror(ET_ERROR, "CURRENT used in non-rule query"); + mmerror(ET_ERROR, "OLD used in non-rule query"); } | NEW { @@ -5102,40 +5101,39 @@ TokenId: ABSOLUTE { $$ = make_str("absolute"); } ; ECPGColLabel: ECPGColId { $$ = $1; } - | ABORT_TRANS { $$ = make_str("abort"); } + | ABORT_TRANS { $$ = make_str("abort"); } | ALL { $$ = make_str("all"); } - | ANALYZE { $$ = make_str("analyze"); } + | ANALYZE { $$ = make_str("analyze"); } | ANY { $$ = make_str("any"); } | ASC { $$ = make_str("asc"); } - | BETWEEN { $$ = make_str("between"); } - | BINARY { $$ = make_str("binary"); } - | BIT { $$ = make_str("bit"); } + | BETWEEN { $$ = make_str("between"); } + | BINARY { $$ = make_str("binary"); } + | BIT { $$ = make_str("bit"); } | BOTH { $$ = make_str("both"); } - | CASE { $$ = make_str("case"); } + | CASE { $$ = make_str("case"); } | CAST { $$ = make_str("cast"); } - | CHARACTER { $$ = make_str("character"); } + | CHARACTER { $$ = make_str("character"); } | CHECK { $$ = make_str("check"); } | CLUSTER { $$ = make_str("cluster"); } - | COALESCE { $$ = make_str("coalesce"); } + | COALESCE { $$ = make_str("coalesce"); } | COLLATE { $$ = make_str("collate"); } | COLUMN { $$ = make_str("column"); } - | CONSTRAINT { $$ = make_str("constraint"); } + | CONSTRAINT { $$ = make_str("constraint"); } | COPY { $$ = make_str("copy"); } | CROSS { $$ = make_str("cross"); } - | CURRENT { $$ = make_str("current"); } - | CURRENT_DATE { $$ = make_str("current_date"); } - | CURRENT_TIME { $$ = make_str("current_time"); } + | CURRENT_DATE { $$ = make_str("current_date"); } + | CURRENT_TIME { $$ = make_str("current_time"); } | CURRENT_TIMESTAMP { $$ = make_str("current_timestamp"); } | CURRENT_USER { $$ = make_str("current_user"); } | DEC { $$ = make_str("dec"); } | DECIMAL { $$ = make_str("decimal"); } | DEFAULT { $$ = make_str("default"); } - | DEFERRABLE { $$ = make_str("deferrable"); } + | DEFERRABLE { $$ = make_str("deferrable"); } | DESC { $$ = make_str("desc"); } | DISTINCT { $$ = make_str("distinct"); } | DO { $$ = make_str("do"); } - | ELSE { $$ = make_str("else"); } - | END_TRANS { $$ = make_str("end"); } + | ELSE { $$ = make_str("else"); } + | END_TRANS { $$ = make_str("end"); } | EXCEPT { $$ = make_str("except"); } | EXISTS { $$ = make_str("exists"); } | EXPLAIN { $$ = make_str("explain"); } @@ -5146,9 +5144,9 @@ ECPGColLabel: ECPGColId { $$ = $1; } | FOREIGN { $$ = make_str("foreign"); } | FROM { $$ = make_str("from"); } | FULL { $$ = make_str("full"); } - | IN { $$ = make_str("in"); } - | IS { $$ = make_str("is"); } - | ISNULL { $$ = make_str("isnull"); } + | IN { $$ = make_str("in"); } + | IS { $$ = make_str("is"); } + | ISNULL { $$ = make_str("isnull"); } | GLOBAL { $$ = make_str("global"); } | GROUP { $$ = make_str("group"); } | HAVING { $$ = make_str("having"); } @@ -5169,33 +5167,34 @@ ECPGColLabel: ECPGColId { $$ = $1; } | NEW { $$ = make_str("new"); } | NONE { $$ = make_str("none"); } | NOT { $$ = make_str("not"); } - | NOTNULL { $$ = make_str("notnull"); } - | NULLIF { $$ = make_str("nullif"); } + | NOTNULL { $$ = make_str("notnull"); } + | NULLIF { $$ = make_str("nullif"); } | NULL_P { $$ = make_str("null"); } - | NUMERIC { $$ = make_str("numeric"); } + | NUMERIC { $$ = make_str("numeric"); } | OFFSET { $$ = make_str("offset"); } + | OLD { $$ = make_str("old"); } | ON { $$ = make_str("on"); } | OR { $$ = make_str("or"); } | ORDER { $$ = make_str("order"); } | OUTER_P { $$ = make_str("outer"); } - | OVERLAPS { $$ = make_str("overlaps"); } + | OVERLAPS { $$ = make_str("overlaps"); } | POSITION { $$ = make_str("position"); } | PRECISION { $$ = make_str("precision"); } | PRIMARY { $$ = make_str("primary"); } | PROCEDURE { $$ = make_str("procedure"); } | PUBLIC { $$ = make_str("public"); } - | REFERENCES { $$ = make_str("references"); } + | REFERENCES { $$ = make_str("references"); } | RESET { $$ = make_str("reset"); } | RIGHT { $$ = make_str("right"); } | SELECT { $$ = make_str("select"); } - | SESSION_USER { $$ = make_str("session_user"); } + | SESSION_USER { $$ = make_str("session_user"); } | SETOF { $$ = make_str("setof"); } | SHOW { $$ = make_str("show"); } | SUBSTRING { $$ = make_str("substring"); } | TABLE { $$ = make_str("table"); } - | THEN { $$ = make_str("then"); } + | THEN { $$ = make_str("then"); } | TO { $$ = make_str("to"); } - | TRANSACTION { $$ = make_str("transaction"); } + | TRANSACTION { $$ = make_str("transaction"); } | TRIM { $$ = make_str("trim"); } | TRUE_P { $$ = make_str("true"); } | UNIQUE { $$ = make_str("unique"); } @@ -5203,7 +5202,7 @@ ECPGColLabel: ECPGColId { $$ = $1; } | USING { $$ = make_str("using"); } | VACUUM { $$ = make_str("vacuum"); } | VERBOSE { $$ = make_str("verbose"); } - | WHEN { $$ = make_str("when"); } + | WHEN { $$ = make_str("when"); } | WHERE { $$ = make_str("where"); } ; diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 8296a1b938..34059b8a6e 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1168,7 +1168,7 @@ SELECT viewname, definition FROM pg_views ORDER BY viewname; pg_indexes | SELECT c.relname AS tablename, i.relname AS indexname, pg_get_indexdef(x.indexrelid) AS indexdef FROM pg_index x, pg_class c, pg_class i WHERE ((c.oid = x.indrelid) AND (i.oid = x.indexrelid)); pg_rules | SELECT c.relname AS tablename, r.rulename, pg_get_ruledef(r.rulename) AS definition FROM pg_rewrite r, pg_class c WHERE ((r.rulename !~ '^_RET'::text) AND (c.oid = r.ev_class)); pg_tables | SELECT c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM pg_class c WHERE (((c.relkind = 'r'::"char") OR (c.relkind = 's'::"char")) AND (NOT (EXISTS (SELECT pg_rewrite.rulename FROM pg_rewrite WHERE ((pg_rewrite.ev_class = c.oid) AND (pg_rewrite.ev_type = '1'::"char")))))); - pg_user | SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usecreatetable, pg_shadow.uselocktable, pg_shadow.usetrace, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil FROM pg_shadow; + pg_user | SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usetrace, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil FROM pg_shadow; pg_views | SELECT c.relname AS viewname, pg_get_userbyid(c.relowner) AS viewowner, pg_get_viewdef(c.relname) AS definition FROM pg_class c WHERE (c.relhasrules AND (EXISTS (SELECT r.rulename FROM pg_rewrite r WHERE ((r.ev_class = c.oid) AND (r.ev_type = '1'::"char"))))); rtest_v1 | SELECT rtest_t1.a, rtest_t1.b FROM rtest_t1; rtest_vcomp | SELECT x.part, (x.size * y.factor) AS size_in_cm FROM rtest_comp x, rtest_unitfact y WHERE (x.unit = y.unit);