aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2011-06-17 09:43:32 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2011-06-20 10:50:23 -0400
commita40a5d9468a5f9f11d355ebf07f7741f5c267588 (patch)
treef387f43fb3430f2c10715fae92c85b6d85f90917 /src/backend/executor/execMain.c
parentbddc35ac664bc16a8953d0d46bf85e80b78bc493 (diff)
downloadpostgresql-a40a5d9468a5f9f11d355ebf07f7741f5c267588.tar.gz
postgresql-a40a5d9468a5f9f11d355ebf07f7741f5c267588.zip
Remove extra copying of TupleDescs for heap_create_with_catalog
Some callers were creating copies of tuple descriptors to pass to that function, stating in code comments that it was necessary because it modified the passed descriptor. Code inspection reveals this not to be true, and indeed not all callers are passing copies in the first place. So remove the extra ones and the misleading comments about this behavior as well.
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r--src/backend/executor/execMain.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index df1d3cab4d1..2f8deb470c5 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -2394,7 +2394,6 @@ OpenIntoRel(QueryDesc *queryDesc)
Oid tablespaceId;
Datum reloptions;
Oid intoRelationId;
- TupleDesc tupdesc;
DR_intorel *myState;
static char *validnsps[] = HEAP_RELOPT_NAMESPACES;
@@ -2467,9 +2466,6 @@ OpenIntoRel(QueryDesc *queryDesc)
false);
(void) heap_reloptions(RELKIND_RELATION, reloptions, true);
- /* Copy the tupdesc because heap_create_with_catalog modifies it */
- tupdesc = CreateTupleDescCopy(queryDesc->tupDesc);
-
/* Now we can actually create the new relation */
intoRelationId = heap_create_with_catalog(intoName,
namespaceId,
@@ -2478,7 +2474,7 @@ OpenIntoRel(QueryDesc *queryDesc)
InvalidOid,
InvalidOid,
GetUserId(),
- tupdesc,
+ queryDesc->tupDesc,
NIL,
RELKIND_RELATION,
into->rel->relpersistence,
@@ -2492,8 +2488,6 @@ OpenIntoRel(QueryDesc *queryDesc)
allowSystemTableMods);
Assert(intoRelationId != InvalidOid);
- FreeTupleDesc(tupdesc);
-
/*
* Advance command counter so that the newly-created relation's catalog
* tuples will be visible to heap_open.