File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.129 2004/08/29 05:06:41 momjian Exp $
11
+ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.130 2004/08/31 15:56:39 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -5434,7 +5434,7 @@ ATExecSetTableSpace(Oid tableOid, Oid newTableSpace)
5434
5434
static void
5435
5435
copy_relation_data (Relation rel , SMgrRelation dst )
5436
5436
{
5437
- SMgrRelation src = rel -> rd_smgr ;
5437
+ SMgrRelation src ;
5438
5438
bool use_wal ;
5439
5439
BlockNumber nblocks ;
5440
5440
BlockNumber blkno ;
@@ -5457,6 +5457,9 @@ copy_relation_data(Relation rel, SMgrRelation dst)
5457
5457
use_wal = XLogArchivingActive () && !rel -> rd_istemp ;
5458
5458
5459
5459
nblocks = RelationGetNumberOfBlocks (rel );
5460
+ /* RelationGetNumberOfBlocks will certainly have opened rd_smgr */
5461
+ src = rel -> rd_smgr ;
5462
+
5460
5463
for (blkno = 0 ; blkno < nblocks ; blkno ++ )
5461
5464
{
5462
5465
smgrread (src , blkno , buf );
You can’t perform that action at this time.
0 commit comments