]> granicus.if.org Git - postgresql/commitdiff
Rename rule CURRENT to OLD in source tree. Add mapping for backward
authorBruce Momjian <bruce@momjian.us>
Mon, 12 Jun 2000 19:40:58 +0000 (19:40 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 12 Jun 2000 19:40:58 +0000 (19:40 +0000)
compatiblity with old rules.

12 files changed:
src/backend/commands/view.c
src/backend/parser/analyze.c
src/backend/parser/gram.y
src/backend/parser/keywords.c
src/backend/parser/parse_relation.c
src/backend/rewrite/rewriteHandler.c
src/backend/utils/adt/ruleutils.c
src/include/nodes/primnodes.h
src/include/parser/parsetree.h
src/interfaces/ecpg/preproc/keywords.c
src/interfaces/ecpg/preproc/preproc.y
src/test/regress/expected/rules.out

index f4bb18762b805325048436507f9aea982bd6a86b..cbe87b5e0ed07fd4a21f22b3fa3cc2412909937d 100644 (file)
@@ -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...
         */
index 5de51410fe8fb6215352383c3fec0f71bf086967..dbd8faf319b60b05ac067cce55275578f466cab6 100644 (file)
@@ -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),
index 925d2ab77f67679d89c8a98a6e7ff5c7c3776125..3f52e80105028dcc776031f6fc9fc5e4f3a6c1df 100644 (file)
@@ -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
                                {
index f167cb3c7e3c38a9bd2f37e2fcd44dce30ffb712..76428b969c54ede44a2c39127cb5fb75dc1213ac 100644 (file)
@@ -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},
index c871222ab351ad99287637b1c067e996bdaa839a..41065c69077263d826e980ff8cd2bb6889780ae5 100644 (file)
@@ -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);
                }
index 3a3a76606f850c25beea1804076335f59c5a7eb7..2fbf6bbb690283d4110642d06d3df8dfab8656bd 100644 (file)
@@ -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);
index e32bf2fff5560a049bc87d93b46a24e8cc08dfa5..7bee5abe2828a673abae7715ff46aaf6b1088f2f 100644 (file)
@@ -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.",
index 23b91647c2cc77ebe30a0f475ee35751c0a7f189..6f675873cc8558a4c34c832f6568452dc5566916 100644 (file)
@@ -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
 {
index 3f5e09cc1df48a74d8b89fc3a55284a9eb1a21ac..277bc32a504883f50adbd4a2294523f9c57f1aa5 100644 (file)
@@ -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))
 
index 75676d00e90ec8334c26973756905c45675c52d1..dd93a1c2d6f24fb3b049ec4fd7f23effa9659586 100644 (file)
@@ -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},
index b09aa80c6c483bbaad5c3b27158985b3ec8b205e..d45322ac17c24f39e079f6854e28ec1ba2b0db90 100644 (file)
@@ -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 <str>    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"); }
                ;
 
index 8296a1b938ecd0d091e47a1d3dd3b89ab9c8d5e1..34059b8a6e7ab0bcfc60b2727b7cf5bbf9ad9008 100644 (file)
@@ -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);