aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/cluster.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/commands/cluster.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/commands/cluster.c')
-rw-r--r--src/backend/commands/cluster.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index c020dc2e4ec..9a7649bb4f9 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -591,8 +591,7 @@ rebuild_relation(Relation OldHeap, Oid indexOid,
Oid
make_new_heap(Oid OIDOldHeap, Oid NewTableSpace)
{
- TupleDesc OldHeapDesc,
- tupdesc;
+ TupleDesc OldHeapDesc;
char NewHeapName[NAMEDATALEN];
Oid OIDNewHeap;
Oid toastid;
@@ -605,13 +604,11 @@ make_new_heap(Oid OIDOldHeap, Oid NewTableSpace)
OldHeapDesc = RelationGetDescr(OldHeap);
/*
- * Need to make a copy of the tuple descriptor, since
- * heap_create_with_catalog modifies it. Note that the NewHeap will not
+ * Note that the NewHeap will not
* receive any of the defaults or constraints associated with the OldHeap;
* we don't need 'em, and there's no reason to spend cycles inserting them
* into the catalogs only to delete them.
*/
- tupdesc = CreateTupleDescCopy(OldHeapDesc);
/*
* But we do want to use reloptions of the old heap for new heap.
@@ -645,7 +642,7 @@ make_new_heap(Oid OIDOldHeap, Oid NewTableSpace)
InvalidOid,
InvalidOid,
OldHeap->rd_rel->relowner,
- tupdesc,
+ OldHeapDesc,
NIL,
OldHeap->rd_rel->relkind,
OldHeap->rd_rel->relpersistence,