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.
This commit is contained in:
Peter Eisentraut 2009-01-12 09:38:30 +00:00
parent ca8100f9eb
commit bf21cdb7e7

View File

@ -11,7 +11,7 @@
*
*
* 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
* AUTHOR DATE MAJOR EVENT
@ -1503,7 +1503,7 @@ AlterTableStmt:
n->relkind = OBJECT_TABLE;
$$ = (Node *)n;
}
| ALTER INDEX relation_expr alter_table_cmds
| ALTER INDEX qualified_name alter_table_cmds
{
AlterTableStmt *n = makeNode(AlterTableStmt);
n->relation = $3;
@ -1511,7 +1511,7 @@ AlterTableStmt:
n->relkind = OBJECT_INDEX;
$$ = (Node *)n;
}
| ALTER SEQUENCE relation_expr alter_table_cmds
| ALTER SEQUENCE qualified_name alter_table_cmds
{
AlterTableStmt *n = makeNode(AlterTableStmt);
n->relation = $3;
@ -1519,7 +1519,7 @@ AlterTableStmt:
n->relkind = OBJECT_SEQUENCE;
$$ = (Node *)n;
}
| ALTER VIEW relation_expr alter_table_cmds
| ALTER VIEW qualified_name alter_table_cmds
{
AlterTableStmt *n = makeNode(AlterTableStmt);
n->relation = $3;
@ -2548,7 +2548,7 @@ CreateSeqStmt:
;
AlterSeqStmt:
ALTER SEQUENCE relation_expr SeqOptList
ALTER SEQUENCE qualified_name SeqOptList
{
AlterSeqStmt *n = makeNode(AlterSeqStmt);
n->sequence = $3;
@ -5185,7 +5185,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $6;
$$ = (Node *)n;
}
| ALTER SEQUENCE relation_expr RENAME TO name
| ALTER SEQUENCE qualified_name RENAME TO name
{
RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_SEQUENCE;
@ -5194,7 +5194,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $6;
$$ = (Node *)n;
}
| ALTER VIEW relation_expr RENAME TO name
| ALTER VIEW qualified_name RENAME TO name
{
RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_VIEW;
@ -5203,7 +5203,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $6;
$$ = (Node *)n;
}
| ALTER INDEX relation_expr RENAME TO name
| ALTER INDEX qualified_name RENAME TO name
{
RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_INDEX;
@ -5221,7 +5221,7 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
n->newname = $8;
$$ = (Node *)n;
}
| ALTER TRIGGER name ON relation_expr RENAME TO name
| ALTER TRIGGER name ON qualified_name RENAME TO name
{
RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_TRIGGER;
@ -5345,7 +5345,7 @@ AlterObjectSchemaStmt:
n->newschema = $6;
$$ = (Node *)n;
}
| ALTER SEQUENCE relation_expr SET SCHEMA name
| ALTER SEQUENCE qualified_name SET SCHEMA name
{
AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
n->objectType = OBJECT_SEQUENCE;
@ -5353,7 +5353,7 @@ AlterObjectSchemaStmt:
n->newschema = $6;
$$ = (Node *)n;
}
| ALTER VIEW relation_expr SET SCHEMA name
| ALTER VIEW qualified_name SET SCHEMA name
{
AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
n->objectType = OBJECT_VIEW;