Code review for ALTER INDEX patch.

This commit is contained in:
Tom Lane 2004-08-22 00:08:28 +00:00
parent 235caf4bb2
commit 37d937ea2c
5 changed files with 18 additions and 11 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/alter.c,v 1.8 2004/06/25 21:55:53 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/alter.c,v 1.9 2004/08/22 00:08:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -89,6 +89,7 @@ ExecRenameStmt(RenameStmt *stmt)
break;
case OBJECT_TABLE:
case OBJECT_INDEX:
case OBJECT_COLUMN:
case OBJECT_TRIGGER:
{
@ -101,6 +102,7 @@ ExecRenameStmt(RenameStmt *stmt)
switch (stmt->renameType)
{
case OBJECT_TABLE:
case OBJECT_INDEX:
{
/*
* RENAME TABLE requires that we (still) hold

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.289 2004/08/02 04:26:05 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.290 2004/08/22 00:08:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1626,6 +1626,7 @@ _copyAlterTableStmt(AlterTableStmt *from)
COPY_NODE_FIELD(relation);
COPY_NODE_FIELD(cmds);
COPY_SCALAR_FIELD(relkind);
return newnode;
}

View File

@ -18,7 +18,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.228 2004/08/02 04:26:05 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.229 2004/08/22 00:08:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -727,6 +727,7 @@ _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
{
COMPARE_NODE_FIELD(relation);
COMPARE_NODE_FIELD(cmds);
COMPARE_SCALAR_FIELD(relkind);
return true;
}

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.308 2004/08/02 04:26:29 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.309 2004/08/22 00:08:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1421,6 +1421,7 @@ transformFKConstraints(ParseState *pstate, CreateStmtContext *cxt,
alterstmt->relation = cxt->relation;
alterstmt->cmds = NIL;
alterstmt->relkind = OBJECT_TABLE;
foreach(fkclist, cxt->fkconstraints)
{

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.472 2004/08/20 04:29:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.473 2004/08/22 00:08:28 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -1166,6 +1166,7 @@ alter_table_cmds:
| alter_table_cmds ',' alter_table_cmd { $$ = lappend($1, $3); }
;
/* Subcommands that are for ALTER TABLE only */
alter_table_cmd:
/* ALTER TABLE <relation> ADD [COLUMN] <coldef> */
ADD opt_column columnDef
@ -1293,13 +1294,14 @@ alter_table_cmd:
}
;
alter_rel_cmds: alter_rel_cmd { $$ = list_make1($1); }
| alter_rel_cmds ',' alter_rel_cmd { $$ = lappend($1, $3); }
;
alter_rel_cmds:
alter_rel_cmd { $$ = list_make1($1); }
| alter_rel_cmds ',' alter_rel_cmd { $$ = lappend($1, $3); }
;
/* Subcommands that are for ALTER TABLE or ALTER INDEX */
alter_rel_cmd:
/* ALTER [ TABLE | INDEX ] <name> OWNER TO UserId */
/* ALTER [TABLE|INDEX] <name> OWNER TO UserId */
OWNER TO UserId
{
AlterTableCmd *n = makeNode(AlterTableCmd);
@ -1307,7 +1309,7 @@ alter_rel_cmd:
n->name = $3;
$$ = (Node *)n;
}
/* ALTER [ TABLE | INDEX ] <name> SET TABLESPACE <tablespacename> */
/* ALTER [TABLE|INDEX] <name> SET TABLESPACE <tablespacename> */
| SET TABLESPACE name
{
AlterTableCmd *n = makeNode(AlterTableCmd);