diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-23 05:10:57 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-23 05:10:57 +0000 |
| commit | 01376c215c4ec02e05fe0b8f543b178666f57535 (patch) | |
| tree | 940f4c6540eae33c735e445c368197188a8684ad /src/backend/executor/execUtils.c | |
| parent | d73531209cdb7d066b9e5b0fd7a380605e20ffbf (diff) | |
Change CREATE TABLE AS / SELECT INTO to create the new table with OIDs,
for backwards compatibility with pre-7.3 behavior. Per discussion on
pgsql-general and pgsql-hackers.
Diffstat (limited to 'src/backend/executor/execUtils.c')
| -rw-r--r-- | src/backend/executor/execUtils.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index 86440d10f9e..079ffd15016 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.90 2002/09/04 20:31:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.90.2.1 2003/01/23 05:10:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -310,14 +310,23 @@ ExecAssignResultTypeFromTL(Plan *node, CommonState *commonstate) * have to make the decision on a per-relation basis as we initialize * each of the child plans of the topmost Append plan. So, this is * ugly but it works, for now ... + * + * SELECT INTO is also pretty grotty, because we don't yet have the + * INTO relation's descriptor at this point; we have to look aside + * at a flag set by InitPlan(). */ - ri = node->state->es_result_relation_info; - if (ri != NULL) + if (node->state->es_force_oids) + hasoid = true; + else { - Relation rel = ri->ri_RelationDesc; + ri = node->state->es_result_relation_info; + if (ri != NULL) + { + Relation rel = ri->ri_RelationDesc; - if (rel != NULL) - hasoid = rel->rd_rel->relhasoids; + if (rel != NULL) + hasoid = rel->rd_rel->relhasoids; + } } tupDesc = ExecTypeFromTL(node->targetlist, hasoid); |
