mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Fix error with CREATE PUBLICATION, wal_level=minimal, and new tables.
CREATE PUBLICATION has failed spuriously when applied to a permanent
relation created or rewritten in the current transaction. Make the same
change to another site having the same semantic intent; the second
instance has no user-visible consequences. Back-patch to v13, where
commit c6b92041d3
broke this.
Kyotaro Horiguchi
Discussion: https://postgr.es/m/20210113.160705.2225256954956139776.horikyota.ntt@gmail.com
This commit is contained in:
@@ -126,7 +126,8 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
|
||||
relation = table_open(relationObjectId, NoLock);
|
||||
|
||||
/* Temporary and unlogged relations are inaccessible during recovery. */
|
||||
if (!RelationNeedsWAL(relation) && RecoveryInProgress())
|
||||
if (relation->rd_rel->relpersistence != RELPERSISTENCE_PERMANENT &&
|
||||
RecoveryInProgress())
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("cannot access temporary or unlogged relations during recovery")));
|
||||
|
Reference in New Issue
Block a user