Commit bf21cdb7 authored by Peter Eisentraut's avatar Peter Eisentraut

Use qualified_name instead of relation_expr for commands that have no

business with inheritance recursion: ALTER INDEX, ALTER SEQUENCE, ALTER
TRIGGER, ALTER VIEW.  They would just silently ignore the ONLY.

ALTER TABLE has mixed behavior and cannot be dealt with this way because
of the resulting shift/reduce conflicts.
parent ca8100f9
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.653 2009/01/12 08:54:26 petere Exp $ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.654 2009/01/12 09:38:30 petere Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -1503,7 +1503,7 @@ AlterTableStmt: ...@@ -1503,7 +1503,7 @@ AlterTableStmt:
n->relkind = OBJECT_TABLE; n->relkind = OBJECT_TABLE;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER INDEX relation_expr alter_table_cmds | ALTER INDEX qualified_name alter_table_cmds
{ {
AlterTableStmt *n = makeNode(AlterTableStmt); AlterTableStmt *n = makeNode(AlterTableStmt);
n->relation = $3; n->relation = $3;
...@@ -1511,7 +1511,7 @@ AlterTableStmt: ...@@ -1511,7 +1511,7 @@ AlterTableStmt:
n->relkind = OBJECT_INDEX; n->relkind = OBJECT_INDEX;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER SEQUENCE relation_expr alter_table_cmds | ALTER SEQUENCE qualified_name alter_table_cmds
{ {
AlterTableStmt *n = makeNode(AlterTableStmt); AlterTableStmt *n = makeNode(AlterTableStmt);
n->relation = $3; n->relation = $3;
...@@ -1519,7 +1519,7 @@ AlterTableStmt: ...@@ -1519,7 +1519,7 @@ AlterTableStmt:
n->relkind = OBJECT_SEQUENCE; n->relkind = OBJECT_SEQUENCE;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER VIEW relation_expr alter_table_cmds | ALTER VIEW qualified_name alter_table_cmds
{ {
AlterTableStmt *n = makeNode(AlterTableStmt); AlterTableStmt *n = makeNode(AlterTableStmt);
n->relation = $3; n->relation = $3;
...@@ -2548,7 +2548,7 @@ CreateSeqStmt: ...@@ -2548,7 +2548,7 @@ CreateSeqStmt:
; ;
AlterSeqStmt: AlterSeqStmt:
ALTER SEQUENCE relation_expr SeqOptList ALTER SEQUENCE qualified_name SeqOptList
{ {
AlterSeqStmt *n = makeNode(AlterSeqStmt); AlterSeqStmt *n = makeNode(AlterSeqStmt);
n->sequence = $3; n->sequence = $3;
...@@ -5185,7 +5185,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name ...@@ -5185,7 +5185,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $6; n->newname = $6;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER SEQUENCE relation_expr RENAME TO name | ALTER SEQUENCE qualified_name RENAME TO name
{ {
RenameStmt *n = makeNode(RenameStmt); RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_SEQUENCE; n->renameType = OBJECT_SEQUENCE;
...@@ -5194,7 +5194,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name ...@@ -5194,7 +5194,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $6; n->newname = $6;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER VIEW relation_expr RENAME TO name | ALTER VIEW qualified_name RENAME TO name
{ {
RenameStmt *n = makeNode(RenameStmt); RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_VIEW; n->renameType = OBJECT_VIEW;
...@@ -5203,7 +5203,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name ...@@ -5203,7 +5203,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $6; n->newname = $6;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER INDEX relation_expr RENAME TO name | ALTER INDEX qualified_name RENAME TO name
{ {
RenameStmt *n = makeNode(RenameStmt); RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_INDEX; n->renameType = OBJECT_INDEX;
...@@ -5221,7 +5221,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name ...@@ -5221,7 +5221,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $8; n->newname = $8;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER TRIGGER name ON relation_expr RENAME TO name | ALTER TRIGGER name ON qualified_name RENAME TO name
{ {
RenameStmt *n = makeNode(RenameStmt); RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_TRIGGER; n->renameType = OBJECT_TRIGGER;
...@@ -5345,7 +5345,7 @@ AlterObjectSchemaStmt: ...@@ -5345,7 +5345,7 @@ AlterObjectSchemaStmt:
n->newschema = $6; n->newschema = $6;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER SEQUENCE relation_expr SET SCHEMA name | ALTER SEQUENCE qualified_name SET SCHEMA name
{ {
AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
n->objectType = OBJECT_SEQUENCE; n->objectType = OBJECT_SEQUENCE;
...@@ -5353,7 +5353,7 @@ AlterObjectSchemaStmt: ...@@ -5353,7 +5353,7 @@ AlterObjectSchemaStmt:
n->newschema = $6; n->newschema = $6;
$$ = (Node *)n; $$ = (Node *)n;
} }
| ALTER VIEW relation_expr SET SCHEMA name | ALTER VIEW qualified_name SET SCHEMA name
{ {
AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
n->objectType = OBJECT_VIEW; n->objectType = OBJECT_VIEW;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment