diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-12-01 23:44:44 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-12-01 23:44:44 +0000 |
commit | 265f904d8f25db2f0272921e25a1397f548d235d (patch) | |
tree | bc1bd0992294e3bc13bf7c4f8409301143a1e40e /src/backend/commands | |
parent | ba9da684b5dba9dc5daf05abd442f9b4a5a23979 (diff) | |
download | postgresql-265f904d8f25db2f0272921e25a1397f548d235d.tar.gz postgresql-265f904d8f25db2f0272921e25a1397f548d235d.zip |
Code review for LIKE ... INCLUDING INDEXES patch. Fix failure to propagate
constraint status of copied indexes (bug #3774), as well as various other
small bugs such as failure to pstrdup when needed. Allow INCLUDING INDEXES
indexes to be merged with identical declared indexes (perhaps not real useful,
but the code is there and having it not apply to LIKE indexes seems pretty
unorthogonal). Avoid useless work in generateClonedIndexStmt(). Undo some
poorly chosen API changes, and put a couple of routines in modules that seem
to be better places for them.
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/indexcmds.c | 16 | ||||
-rw-r--r-- | src/backend/commands/tablecmds.c | 3 |
2 files changed, 4 insertions, 15 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index dc53546a05f..1ae51246e79 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.167 2007/11/15 21:14:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.168 2007/12/01 23:44:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -80,8 +80,6 @@ static bool relationHasPrimaryKey(Relation rel); * to index on. * 'predicate': the partial-index condition, or NULL if none. * 'options': reloptions from WITH (in list-of-DefElem form). - * 'src_options': reloptions from the source index, if this is a cloned - * index produced by CREATE TABLE LIKE ... INCLUDING INDEXES * 'unique': make the index enforce uniqueness. * 'primary': mark the index as a primary key in the catalogs. * 'isconstraint': index is for a PRIMARY KEY or UNIQUE constraint, @@ -103,7 +101,6 @@ DefineIndex(RangeVar *heapRelation, List *attributeList, Expr *predicate, List *options, - char *src_options, bool unique, bool primary, bool isconstraint, @@ -396,16 +393,9 @@ DefineIndex(RangeVar *heapRelation, } /* - * Parse AM-specific options, convert to text array form, validate. The - * src_options introduced due to using indexes via the "CREATE LIKE - * INCLUDING INDEXES" statement also need to be merged here + * Parse AM-specific options, convert to text array form, validate. */ - if (src_options) - reloptions = unflatten_reloptions(src_options); - else - reloptions = (Datum) 0; - - reloptions = transformRelOptions(reloptions, options, false, false); + reloptions = transformRelOptions((Datum) 0, options, false, false); (void) index_reloptions(amoptions, reloptions, true); diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 285bc234967..2310c821d03 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.236 2007/11/15 21:14:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.237 2007/12/01 23:44:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -3795,7 +3795,6 @@ ATExecAddIndex(AlteredTableInfo *tab, Relation rel, stmt->indexParams, /* parameters */ (Expr *) stmt->whereClause, stmt->options, - stmt->src_options, stmt->unique, stmt->primary, stmt->isconstraint, |