summaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorTom Lane2009-11-05 23:24:27 +0000
committerTom Lane2009-11-05 23:24:27 +0000
commit593f4b854a8bb384547b8fa9854c73dcd88d4876 (patch)
tree7df8238f7a7eac1e4afcb11840b1f01e6abd2eb1 /src/interfaces
parent45d7e04fce5c00b1242787bc0fc150f9ecaf029e (diff)
Don't treat NEW and OLD as reserved words anymore. For the purposes of rules
it works just as well to have them be ordinary identifiers, and this gets rid of a number of ugly special cases. Plus we aren't interfering with non-rule usage of these names. catversion bump because the names change internally in stored rules.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.addons8
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.header4
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.trailer12
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.type3
-rw-r--r--src/interfaces/ecpg/preproc/parse.pl3
5 files changed, 6 insertions, 24 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 884ce9eb836..75506161700 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -1,4 +1,4 @@
-/* $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
{
@@ -377,12 +377,6 @@ ECPG: FetchStmtMOVEname rule
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");
diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header
index e483b481fdd..fbf0bd05b55 100644
--- a/src/interfaces/ecpg/preproc/ecpg.header
+++ b/src/interfaces/ecpg/preproc/ecpg.header
@@ -1,4 +1,4 @@
-/* $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 */
%{
@@ -37,7 +37,7 @@ int ecpg_informix_var = 0;
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 */
diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer
index 5eb43937ca8..eca263b2491 100644
--- a/src/interfaces/ecpg/preproc/ecpg.trailer
+++ b/src/interfaces/ecpg/preproc/ecpg.trailer
@@ -1,4 +1,4 @@
-/* $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
@@ -28,16 +28,6 @@ CreateAsStmt: CREATE OptTemp TABLE create_as_target AS {FoundInto = 0;} SelectSt
}
;
-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;
diff --git a/src/interfaces/ecpg/preproc/ecpg.type b/src/interfaces/ecpg/preproc/ecpg.type
index 11f3d232fc2..e26146dc84c 100644
--- a/src/interfaces/ecpg/preproc/ecpg.type
+++ b/src/interfaces/ecpg/preproc/ecpg.type
@@ -1,4 +1,4 @@
-/* $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
@@ -90,7 +90,6 @@
%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
diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl
index aa76daf08b1..168a86bd19a 100644
--- a/src/interfaces/ecpg/preproc/parse.pl
+++ b/src/interfaces/ecpg/preproc/parse.pl
@@ -1,5 +1,5 @@
#!/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
#
@@ -51,7 +51,6 @@ $replace_types{'stmtblock'} = 'ignore';
$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';