提交 51190fc1 编写于 作者: H Heikki Linnakangas 提交者: Xin Zhang

Fix WAL-logging of ALTER TABLE SET TABLESPACE.

Since we have backported streaming replication from PostgreSQL 9.0, we
need to use XLogIsNeeded() rather than XLogArchivingActive(), to determine
if WAL-logging is needed.

This explains the 'CS_switch' TINC test failure.
上级 d171843c
......@@ -10365,12 +10365,6 @@ copy_relation_data(SMgrRelation src, SMgrRelation dst,
BlockNumber nblocks;
BlockNumber blkno;
/*
* We need to log the copied data in WAL iff WAL archiving is enabled AND
* it's not a temp rel.
*/
use_wal = XLogArchivingActive() && !istemp;
/*
* palloc the buffer so that it's MAXALIGN'd. If it were just a local
* char[] array, the compiler might align it on any byte boundary, which
......@@ -10380,6 +10374,12 @@ copy_relation_data(SMgrRelation src, SMgrRelation dst,
buf = (char *) palloc(BLCKSZ);
page = (Page) buf;
/*
* We need to log the copied data in WAL iff WAL archiving/streaming is
* enabled AND it's not a temp rel.
*/
use_wal = XLogIsNeeded() && !istemp;
nblocks = smgrnblocks(src, forkNum);
for (blkno = 0; blkno < nblocks; blkno++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册