-<!-- $PostgreSQL: pgsql/doc/src/sgml/keywords.sgml,v 2.26 2009/09/22 23:43:37 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/keywords.sgml,v 2.27 2009/11/05 23:24:22 tgl Exp $ -->
<appendix id="sql-keywords-appendix">
<title><acronym>SQL</acronym> Key Words</title>
</row>
<row>
<entry><token>NEW</token></entry>
- <entry>reserved</entry>
+ <entry></entry>
<entry>reserved</entry>
<entry>reserved</entry>
<entry>reserved</entry>
</row>
<row>
<entry><token>OLD</token></entry>
- <entry>reserved</entry>
+ <entry></entry>
<entry>reserved</entry>
<entry>reserved</entry>
<entry>reserved</entry>
-<!-- $PostgreSQL: pgsql/doc/src/sgml/rules.sgml,v 1.52 2008/12/16 03:12:08 momjian Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/rules.sgml,v 1.53 2009/11/05 23:24:22 tgl Exp $ -->
<chapter id="rules">
<title>The Rule System</title>
<note>
<para>
The two extra range
- table entries for <literal>NEW</> and <literal>OLD</> (named <literal>*NEW*</> and <literal>*OLD*</> for
- historical reasons in the printed query tree) you can see in
+ table entries for <literal>NEW</> and <literal>OLD</> that you can see in
the <structname>pg_rewrite</structname> entry aren't of interest
for <command>SELECT</command> rules.
</para>
SELECT s.sl_name, s.sl_avail,
s.sl_color, s.sl_len, s.sl_unit,
s.sl_len * u.un_fact AS sl_len_cm
- FROM shoelace *OLD*, shoelace *NEW*,
+ FROM shoelace old, shoelace new,
shoelace_data s, unit u
WHERE s.sl_unit = u.un_name;
</programlisting>
</programlisting>
There is one difference however: the subquery's range table has two
- extra entries <literal>shoelace *OLD*</> and <literal>shoelace *NEW*</>. These entries don't
+ extra entries <literal>shoelace old</> and <literal>shoelace new</>. These entries don't
participate directly in the query, since they aren't referenced by
the subquery's join tree or target list. The rewriter uses them
to store the access privilege check information that was originally present
the remaining range-table entries in the top query (in this example there
are no more), and it will recursively check the range-table entries in
the added subquery to see if any of them reference views. (But it
- won't expand <literal>*OLD*</> or <literal>*NEW*</> — otherwise we'd have infinite recursion!)
+ won't expand <literal>old</> or <literal>new</> — otherwise we'd have infinite recursion!)
In this example, there are no rewrite rules for <literal>shoelace_data</> or <literal>unit</>,
so rewriting is complete and the above is the final result given to
the planner.
<programlisting>
INSERT INTO shoelace_log VALUES (
- *NEW*.sl_name, *NEW*.sl_avail,
+ new.sl_name, new.sl_avail,
current_user, current_timestamp )
- FROM shoelace_data *NEW*, shoelace_data *OLD*;
+ FROM shoelace_data new, shoelace_data old;
</programlisting>
(This looks a little strange since you cannot normally write
<literal>INSERT ... VALUES ... FROM</>. The <literal>FROM</>
clause here is just to indicate that there are range-table entries
- in the query tree for <literal>*NEW*</> and <literal>*OLD*</>.
+ in the query tree for <literal>new</> and <literal>old</>.
These are needed so that they can be referenced by variables in
the <command>INSERT</command> command's query tree.)
</para>
<programlisting>
INSERT INTO shoelace_log VALUES (
- *NEW*.sl_name, *NEW*.sl_avail,
+ new.sl_name, new.sl_avail,
current_user, current_timestamp )
- FROM shoelace_data *NEW*, shoelace_data *OLD*,
+ FROM shoelace_data new, shoelace_data old,
<emphasis>shoelace_data shoelace_data</emphasis>;
</programlisting>
<programlisting>
INSERT INTO shoelace_log VALUES (
- *NEW*.sl_name, *NEW*.sl_avail,
+ new.sl_name, new.sl_avail,
current_user, current_timestamp )
- FROM shoelace_data *NEW*, shoelace_data *OLD*,
+ FROM shoelace_data new, shoelace_data old,
shoelace_data shoelace_data
- <emphasis>WHERE *NEW*.sl_avail <> *OLD*.sl_avail</emphasis>;
+ <emphasis>WHERE new.sl_avail <> old.sl_avail</emphasis>;
</programlisting>
(This looks even stranger, since <literal>INSERT ... VALUES</> doesn't have
<programlisting>
INSERT INTO shoelace_log VALUES (
- *NEW*.sl_name, *NEW*.sl_avail,
+ new.sl_name, new.sl_avail,
current_user, current_timestamp )
- FROM shoelace_data *NEW*, shoelace_data *OLD*,
+ FROM shoelace_data new, shoelace_data old,
shoelace_data shoelace_data
- WHERE *NEW*.sl_avail <> *OLD*.sl_avail
+ WHERE new.sl_avail <> old.sl_avail
<emphasis>AND shoelace_data.sl_name = 'sl7'</emphasis>;
</programlisting>
</para>
INSERT INTO shoelace_log VALUES (
<emphasis>shoelace_data.sl_name</emphasis>, <emphasis>6</emphasis>,
current_user, current_timestamp )
- FROM shoelace_data *NEW*, shoelace_data *OLD*,
+ FROM shoelace_data new, shoelace_data old,
shoelace_data shoelace_data
- WHERE <emphasis>6</emphasis> <> *OLD*.sl_avail
+ WHERE <emphasis>6</emphasis> <> old.sl_avail
AND shoelace_data.sl_name = 'sl7';
</programlisting>
INSERT INTO shoelace_log VALUES (
shoelace_data.sl_name, 6,
current_user, current_timestamp )
- FROM shoelace_data *NEW*, shoelace_data *OLD*,
+ FROM shoelace_data new, shoelace_data old,
shoelace_data shoelace_data
WHERE 6 <> <emphasis>shoelace_data.sl_avail</emphasis>
AND shoelace_data.sl_name = 'sl7';
UPDATE shoelace
SET sl_avail = shoelace.sl_avail + shoelace_arrive.arr_quant
FROM shoelace_arrive shoelace_arrive, shoelace_ok shoelace_ok,
- shoelace_ok *OLD*, shoelace_ok *NEW*,
+ shoelace_ok old, shoelace_ok new,
shoelace shoelace
WHERE shoelace.sl_name = shoelace_arrive.arr_name;
</programlisting>
sl_len = shoelace.sl_len,
sl_unit = shoelace.sl_unit
FROM shoelace_arrive shoelace_arrive, shoelace_ok shoelace_ok,
- shoelace_ok *OLD*, shoelace_ok *NEW*,
- shoelace shoelace, shoelace *OLD*,
- shoelace *NEW*, shoelace_data shoelace_data
+ shoelace_ok old, shoelace_ok new,
+ shoelace shoelace, shoelace old,
+ shoelace new, shoelace_data shoelace_data
WHERE shoelace.sl_name = shoelace_arrive.arr_name
AND shoelace_data.sl_name = shoelace.sl_name;
</programlisting>
sl_len = s.sl_len,
sl_unit = s.sl_unit
FROM shoelace_arrive shoelace_arrive, shoelace_ok shoelace_ok,
- shoelace_ok *OLD*, shoelace_ok *NEW*,
- shoelace shoelace, shoelace *OLD*,
- shoelace *NEW*, shoelace_data shoelace_data,
- shoelace *OLD*, shoelace *NEW*,
+ shoelace_ok old, shoelace_ok new,
+ shoelace shoelace, shoelace old,
+ shoelace new, shoelace_data shoelace_data,
+ shoelace old, shoelace new,
shoelace_data s, unit u
WHERE s.sl_name = shoelace_arrive.arr_name
AND shoelace_data.sl_name = s.sl_name;
current_user,
current_timestamp
FROM shoelace_arrive shoelace_arrive, shoelace_ok shoelace_ok,
- shoelace_ok *OLD*, shoelace_ok *NEW*,
- shoelace shoelace, shoelace *OLD*,
- shoelace *NEW*, shoelace_data shoelace_data,
- shoelace *OLD*, shoelace *NEW*,
+ shoelace_ok old, shoelace_ok new,
+ shoelace shoelace, shoelace old,
+ shoelace new, shoelace_data shoelace_data,
+ shoelace old, shoelace new,
shoelace_data s, unit u,
- shoelace_data *OLD*, shoelace_data *NEW*
+ shoelace_data old, shoelace_data new
shoelace_log shoelace_log
WHERE s.sl_name = shoelace_arrive.arr_name
AND shoelace_data.sl_name = s.sl_name
-<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.137 2009/10/08 02:39:16 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.138 2009/11/05 23:24:22 tgl Exp $ -->
<chapter id="sql-syntax">
<title>SQL Syntax</title>
<para>
<replaceable>correlation</replaceable> is the name of a
table (possibly qualified with a schema name), or an alias for a table
- defined by means of a <literal>FROM</literal> clause, or one of
- the key words <literal>NEW</literal> or <literal>OLD</literal>.
- (<literal>NEW</literal> and <literal>OLD</literal> can only appear in rewrite rules,
- while other correlation names can be used in any SQL statement.)
+ defined by means of a <literal>FROM</literal> clause.
The correlation name and separating dot can be omitted if the column name
is unique across all the tables being used in the current query. (See also <xref linkend="queries">.)
</para>
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.118 2009/10/13 00:53:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.119 2009/11/05 23:24:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* OLD first, then NEW....
*/
rt_entry1 = addRangeTableEntryForRelation(NULL, viewRel,
- makeAlias("*OLD*", NIL),
+ makeAlias("old", NIL),
false, false);
rt_entry2 = addRangeTableEntryForRelation(NULL, viewRel,
- makeAlias("*NEW*", NIL),
+ makeAlias("new", NIL),
false, false);
/* Must override addRangeTableEntry's default access-check flags */
rt_entry1->requiredPerms = 0;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.687 2009/11/04 23:15:08 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.688 2009/11/05 23:24:23 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
%type <list> TriggerEvents TriggerOneEvent
%type <value> TriggerFuncArg
-%type <str> relation_name copy_file_name
+%type <str> copy_file_name
database_name access_method_clause access_method attr_name
index_name name file_name cluster_index_specification
%type <range> qualified_name OptConstrFromTable
-%type <str> all_Op MathOp SpecialRuleRelation
+%type <str> all_Op MathOp
%type <str> iso_level opt_encoding
%type <node> grantee
MAPPING MATCH MAXVALUE MINUTE_P MINVALUE MODE MONTH_P MOVE
- NAME_P NAMES NATIONAL NATURAL NCHAR NEW NEXT NO NOCREATEDB
+ NAME_P NAMES NATIONAL NATURAL NCHAR NEXT NO NOCREATEDB
NOCREATEROLE NOCREATEUSER NOINHERIT NOLOGIN_P NONE NOSUPERUSER
NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF NULLS_P NUMERIC
- OBJECT_P OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OPTIONS OR
+ OBJECT_P OF OFF OFFSET OIDS ON ONLY OPERATOR OPTION OPTIONS OR
ORDER OUT_P OUTER_P OVER OVERLAPS OVERLAY OWNED OWNER
PARSER PARTIAL PARTITION PASSWORD PLACING PLANS POSITION
*****************************************************************************/
RuleStmt: CREATE opt_or_replace RULE name AS
- { pg_yyget_extra(yyscanner)->QueryIsRule = TRUE; }
ON event TO qualified_name where_clause
DO opt_instead RuleActionList
{
RuleStmt *n = makeNode(RuleStmt);
n->replace = $2;
- n->relation = $10;
+ n->relation = $9;
n->rulename = $4;
- n->whereClause = $11;
- n->event = $8;
- n->instead = $13;
- n->actions = $14;
+ n->whereClause = $10;
+ n->event = $7;
+ n->instead = $12;
+ n->actions = $13;
$$ = (Node *)n;
- pg_yyget_extra(yyscanner)->QueryIsRule = FALSE;
}
;
| /*EMPTY*/ { $$ = NULL; }
;
-/*
- * columnref starts with relation_name not ColId, so that OLD and NEW
- * references can be accepted. Note that when there are more than two
- * dotted names, the first name is not actually a relation name...
- */
-columnref: relation_name
+columnref: ColId
{
$$ = makeColumnRef($1, NIL, @1, yyscanner);
}
- | relation_name indirection
+ | ColId indirection
{
$$ = makeColumnRef($1, $2, @1, yyscanner);
}
*
*****************************************************************************/
-relation_name:
- SpecialRuleRelation { $$ = $1; }
- | ColId { $$ = $1; }
- ;
-
qualified_name_list:
qualified_name { $$ = list_make1($1); }
| qualified_name_list ',' qualified_name { $$ = lappend($1, $3); }
* which may contain subscripts, and reject that case in the C code.
*/
qualified_name:
- relation_name
+ ColId
{
$$ = makeNode(RangeVar);
$$->catalogname = NULL;
$$->relname = $1;
$$->location = @1;
}
- | relation_name indirection
+ | ColId indirection
{
check_qualified_name($2, yyscanner);
$$ = makeNode(RangeVar);
*/
func_name: type_function_name
{ $$ = list_make1(makeString($1)); }
- | relation_name indirection
+ | ColId indirection
{
$$ = check_func_name(lcons(makeString($1), $2),
yyscanner);
| LIMIT
| LOCALTIME
| LOCALTIMESTAMP
- | NEW
| NOT
| NULL_P
| OFF
| OFFSET
- | OLD
| ON
| ONLY
| OR
| WITH
;
-
-SpecialRuleRelation:
- OLD
- {
- if (pg_yyget_extra(yyscanner)->QueryIsRule)
- $$ = "*OLD*";
- else
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("OLD used in query that is not in a rule"),
- parser_errposition(@1)));
- }
- | NEW
- {
- if (pg_yyget_extra(yyscanner)->QueryIsRule)
- $$ = "*NEW*";
- else
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("NEW used in query that is not in a rule"),
- parser_errposition(@1)));
- }
- ;
-
%%
/*
parser_init(base_yy_extra_type *yyext)
{
yyext->parsetree = NIL; /* in case grammar forgets to set it */
- yyext->QueryIsRule = FALSE;
}
/*
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.28 2009/10/13 00:53:08 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.29 2009/11/05 23:24:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* qualification.
*/
oldrte = addRangeTableEntryForRelation(pstate, rel,
- makeAlias("*OLD*", NIL),
+ makeAlias("old", NIL),
false, false);
newrte = addRangeTableEntryForRelation(pstate, rel,
- makeAlias("*NEW*", NIL),
+ makeAlias("new", NIL),
false, false);
/* Must override addRangeTableEntry's default access-check flags */
oldrte->requiredPerms = 0;
* them in the joinlist.
*/
oldrte = addRangeTableEntryForRelation(sub_pstate, rel,
- makeAlias("*OLD*", NIL),
+ makeAlias("old", NIL),
false, false);
newrte = addRangeTableEntryForRelation(sub_pstate, rel,
- makeAlias("*NEW*", NIL),
+ makeAlias("new", NIL),
false, false);
oldrte->requiredPerms = 0;
newrte->requiredPerms = 0;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.138 2009/06/11 14:49:01 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.139 2009/11/05 23:24:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* Recursively scan a query or expression tree and set the checkAsUser
* field to the given userid in all rtable entries.
*
- * Note: for a view (ON SELECT rule), the checkAsUser field of the *OLD*
+ * Note: for a view (ON SELECT rule), the checkAsUser field of the OLD
* RTE entry will be overridden when the view rule is expanded, and the
- * checkAsUser field of the *NEW* entry is irrelevant because that entry's
+ * checkAsUser field of the NEW entry is irrelevant because that entry's
* requiredPerms bits will always be zero. However, for other types of rules
* it's important to set these fields to match the rule owner. So we just set
* them always.
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteHandler.c,v 1.191 2009/10/28 17:36:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteHandler.c,v 1.192 2009/11/05 23:24:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
OffsetVarNodes((Node *) sub_action, rt_length, 0);
OffsetVarNodes(rule_qual, rt_length, 0);
- /* but references to *OLD* should point at original rt_index */
+ /* but references to OLD should point at original rt_index */
ChangeVarNodes((Node *) sub_action,
PRS2_OLD_VARNO + rt_length, rt_index, 0);
ChangeVarNodes(rule_qual,
/*
* We move the view's permission check data down to its rangetable. The
- * checks will actually be done against the *OLD* entry therein.
+ * checks will actually be done against the OLD entry therein.
*/
subrte = rt_fetch(PRS2_OLD_VARNO, rule_action->rtable);
Assert(subrte->relid == relation->rd_id);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteManip.c,v 1.124 2009/10/26 02:26:38 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteManip.c,v 1.125 2009/11/05 23:24:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Currently, this is ONLY applied to rule-action queries, and so we
- * expect to find the *OLD* and *NEW* placeholder entries in the given
+ * expect to find the OLD and NEW placeholder entries in the given
* query. If they're not there, it must be an INSERT/SELECT in which
* they've been pushed down to the SELECT.
*/
if (list_length(parsetree->rtable) >= 2 &&
strcmp(rt_fetch(PRS2_OLD_VARNO, parsetree->rtable)->eref->aliasname,
- "*OLD*") == 0 &&
+ "old") == 0 &&
strcmp(rt_fetch(PRS2_NEW_VARNO, parsetree->rtable)->eref->aliasname,
- "*NEW*") == 0)
+ "new") == 0)
return parsetree;
Assert(parsetree->jointree && IsA(parsetree->jointree, FromExpr));
if (list_length(parsetree->jointree->fromlist) != 1)
elog(ERROR, "expected to find SELECT subquery");
if (list_length(selectquery->rtable) >= 2 &&
strcmp(rt_fetch(PRS2_OLD_VARNO, selectquery->rtable)->eref->aliasname,
- "*OLD*") == 0 &&
+ "old") == 0 &&
strcmp(rt_fetch(PRS2_NEW_VARNO, selectquery->rtable)->eref->aliasname,
- "*NEW*") == 0)
+ "new") == 0)
{
if (subquery_ptr)
*subquery_ptr = &(selectrte->subquery);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.313 2009/10/28 18:51:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.314 2009/11/05 23:24:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (schemaname)
appendStringInfo(buf, "%s.",
quote_identifier(schemaname));
-
- if (strcmp(refname, "*NEW*") == 0)
- appendStringInfoString(buf, "new");
- else if (strcmp(refname, "*OLD*") == 0)
- appendStringInfoString(buf, "old");
- else
- appendStringInfoString(buf, quote_identifier(refname));
-
+ appendStringInfoString(buf, quote_identifier(refname));
if (attname || showstar)
appendStringInfoChar(buf, '.');
}
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.549 2009/11/04 23:47:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.550 2009/11/05 23:24:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200911041
+#define CATALOG_VERSION_NO 200911051
#endif
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/parser/gramparse.h,v 1.48 2009/09/22 23:52:53 petere Exp $
+ * $PostgreSQL: pgsql/src/include/parser/gramparse.h,v 1.49 2009/11/05 23:24:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
List *parsetree; /* final parse result is delivered here */
-
- bool QueryIsRule; /* signals we are parsing CREATE RULE */
} base_yy_extra_type;
/*
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/include/parser/kwlist.h,v 1.5 2009/10/12 20:39:42 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/parser/kwlist.h,v 1.6 2009/11/05 23:24:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PG_KEYWORD("national", NATIONAL, COL_NAME_KEYWORD)
PG_KEYWORD("natural", NATURAL, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("nchar", NCHAR, COL_NAME_KEYWORD)
-PG_KEYWORD("new", NEW, RESERVED_KEYWORD)
PG_KEYWORD("next", NEXT, UNRESERVED_KEYWORD)
PG_KEYWORD("no", NO, UNRESERVED_KEYWORD)
PG_KEYWORD("nocreatedb", NOCREATEDB, UNRESERVED_KEYWORD)
PG_KEYWORD("off", OFF, RESERVED_KEYWORD)
PG_KEYWORD("offset", OFFSET, RESERVED_KEYWORD)
PG_KEYWORD("oids", OIDS, UNRESERVED_KEYWORD)
-PG_KEYWORD("old", OLD, RESERVED_KEYWORD)
PG_KEYWORD("on", ON, RESERVED_KEYWORD)
PG_KEYWORD("only", ONLY, RESERVED_KEYWORD)
PG_KEYWORD("operator", OPERATOR, UNRESERVED_KEYWORD)
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.5 2009/08/14 13:28:22 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.6 2009/11/05 23:24:27 tgl Exp $ */
ECPG: stmtClosePortalStmt block
{
add_additional_variables($3, false);
$$ = cat_str(3, make_str("fetch"), $2, $3);
}
-ECPG: SpecialRuleRelationOLD addon
- if (!QueryIsRule)
- mmerror(PARSE_ERROR, ET_ERROR, "OLD used in query that is not in a rule");
-ECPG: SpecialRuleRelationNEW addon
- if (!QueryIsRule)
- mmerror(PARSE_ERROR, ET_ERROR, "NEW used in query that is not in a rule");
ECPG: select_limitLIMITselect_limit_value','select_offset_value block
{
mmerror(PARSE_ERROR, ET_WARNING, "no longer supported LIMIT #,# syntax passed to server");
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.9 2009/09/08 04:25:00 tgl Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.10 2009/11/05 23:24:27 tgl Exp $ */
/* Copyright comment */
%{
char *connection = NULL;
char *input_filename = NULL;
-static int QueryIsRule = 0, FoundInto = 0;
+static int FoundInto = 0;
static int initializer = 0;
static int pacounter = 1;
static char pacounter_buffer[sizeof(int) * CHAR_BIT * 10 / 3]; /* a rough guess at the size we need */
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.12 2009/09/22 23:43:42 tgl Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.13 2009/11/05 23:24:27 tgl Exp $ */
statements: /*EMPTY*/
| statements statement
}
;
-RuleStmt: CREATE opt_or_replace RULE name AS
- {QueryIsRule = 1;}
- ON event TO qualified_name where_clause
- DO opt_instead RuleActionList
- {
- QueryIsRule=0;
- $$ = cat_str(12, make_str("create"), $2, make_str("rule"), $4, make_str("as on"), $8, make_str("to"), $10, $11, make_str("do"), $13, $14);
- }
- ;
-
at: AT connection_object
{
connection = $2;
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.type,v 1.1 2008/11/14 10:03:33 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.type,v 1.2 2009/11/05 23:24:27 tgl Exp $ */
%type <str> ECPGAllocateDescr
%type <str> ECPGCKeywords
%type <str> ECPGColId
%type <str> precision
%type <str> prepared_name
%type <str> quoted_ident_stringvar
-%type <str> RuleStmt
%type <str> s_struct_union
%type <str> server
%type <str> server_name
#!/usr/bin/perl
-# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/parse.pl,v 1.3 2009/01/29 09:38:38 petere Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/parse.pl,v 1.4 2009/11/05 23:24:27 tgl Exp $
# parser generater for ecpg
# call with backend parser as stdin
#
$replace_types{'stmtmulti'} = 'ignore';
$replace_types{'CreateAsStmt'} = 'ignore';
$replace_types{'DeallocateStmt'} = 'ignore';
-$replace_types{'RuleStmt'} = 'ignore';
$replace_types{'ColLabel'} = 'ignore';
$replace_types{'unreserved_keyword'} = 'ignore';
$replace_types{'Sconst'} = 'ignore';