diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-07-03 22:45:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-07-03 22:45:41 +0000 |
commit | b7b78d24f7fc8d621af40b2e404b6a3f3420e89e (patch) | |
tree | da6b05ca5779ad812557b5d4cd38be79bf524825 /src/backend/executor/execMain.c | |
parent | feed07350b63e32ba2fbe50181df7d40ca2ee33e (diff) | |
download | postgresql-b7b78d24f7fc8d621af40b2e404b6a3f3420e89e.tar.gz postgresql-b7b78d24f7fc8d621af40b2e404b6a3f3420e89e.zip |
Code review for FILLFACTOR patch. Change WITH grammar as per earlier
discussion (including making def_arg allow reserved words), add missed
opt_definition for UNIQUE case. Put the reloptions support code in a less
random place (I chose to make a new file access/common/reloptions.c).
Eliminate header inclusion creep. Make the index options functions safely
user-callable (seems like client apps might like to be able to test validity
of options before trying to make an index). Reduce overhead for normal case
with no options by allowing rd_options to be NULL. Fix some unmaintainably
klugy code, including getting rid of Natts_pg_class_fixed at long last.
Some stylistic cleanup too, and pay attention to keeping comments in sync
with code.
Documentation still needs work, though I did fix the omissions in
catalogs.sgml and indexam.sgml.
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r-- | src/backend/executor/execMain.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index bb03b9358c6..3c9f0798ba4 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -26,13 +26,14 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.272 2006/07/02 02:23:20 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.273 2006/07/03 22:45:38 tgl Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" #include "access/heapam.h" +#include "access/reloptions.h" #include "access/xlog.h" #include "catalog/heap.h" #include "catalog/namespace.h" @@ -45,8 +46,8 @@ #include "miscadmin.h" #include "optimizer/clauses.h" #include "optimizer/var.h" -#include "parser/parse_clause.h" #include "parser/parsetree.h" +#include "parser/parse_clause.h" #include "storage/smgr.h" #include "utils/acl.h" #include "utils/guc.h" @@ -543,7 +544,7 @@ InitPlan(QueryDesc *queryDesc, int eflags) { do_select_into = true; estate->es_select_into = true; - estate->es_into_oids = parseTree->intoHasOids; + estate->es_into_oids = interpretOidsOption(parseTree->intoOptions); } /* @@ -727,10 +728,10 @@ InitPlan(QueryDesc *queryDesc, int eflags) char *intoName; Oid namespaceId; Oid tablespaceId; + Datum reloptions; AclResult aclresult; Oid intoRelationId; TupleDesc tupdesc; - ArrayType *options; /* * Check consistency of arguments @@ -770,6 +771,13 @@ InitPlan(QueryDesc *queryDesc, int eflags) /* note InvalidOid is OK in this case */ } + /* Parse and validate any reloptions */ + reloptions = transformRelOptions((Datum) 0, + parseTree->intoOptions, + true, + false); + (void) heap_reloptions(RELKIND_RELATION, reloptions, true); + /* Check permissions except when using the database's default */ if (OidIsValid(tablespaceId)) { @@ -788,7 +796,6 @@ InitPlan(QueryDesc *queryDesc, int eflags) */ tupdesc = CreateTupleDescCopy(tupType); - options = OptionBuild(NULL, parseTree->intoOptions); intoRelationId = heap_create_with_catalog(intoName, namespaceId, tablespaceId, @@ -800,10 +807,8 @@ InitPlan(QueryDesc *queryDesc, int eflags) true, 0, parseTree->intoOnCommit, - allowSystemTableMods, - options); - if (options) - pfree(options); + reloptions, + allowSystemTableMods); FreeTupleDesc(tupdesc); |