diff options
Diffstat (limited to 'src/backend/access/heap/heapam_handler.c')
-rw-r--r-- | src/backend/access/heap/heapam_handler.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index d15a02b2be7..680a50bf8b1 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -633,8 +633,6 @@ heapam_relation_copy_data(Relation rel, const RelFileLocator *newrlocator) { SMgrRelation dstrel; - dstrel = smgropen(*newrlocator, rel->rd_backend); - /* * Since we copy the file directly without looking at the shared buffers, * we'd better first flush out any pages of the source relation that are @@ -650,7 +648,7 @@ heapam_relation_copy_data(Relation rel, const RelFileLocator *newrlocator) * NOTE: any conflict in relfilenumber value will be caught in * RelationCreateStorage(). */ - RelationCreateStorage(*newrlocator, rel->rd_rel->relpersistence, true); + dstrel = RelationCreateStorage(*newrlocator, rel->rd_rel->relpersistence, true); /* copy main fork */ RelationCopyStorage(RelationGetSmgr(rel), dstrel, MAIN_FORKNUM, |