mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Fix handling of temp and unlogged tables in FOR ALL TABLES publications
If a FOR ALL TABLES publication exists, temporary and unlogged tables are ignored for publishing changes. But CheckCmdReplicaIdentity() would still check in that case that such a table has a replica identity set before accepting updates. To fix, have GetRelationPublicationActions() return that such a table publishes no actions. Discussion: https://www.postgresql.org/message-id/f3f151f7-c4dd-1646-b998-f60bd6217dd3@2ndquadrant.com
This commit is contained in:
7
src/backend/utils/cache/relcache.c
vendored
7
src/backend/utils/cache/relcache.c
vendored
@ -5156,6 +5156,13 @@ GetRelationPublicationActions(Relation relation)
|
||||
MemoryContext oldcxt;
|
||||
PublicationActions *pubactions = palloc0(sizeof(PublicationActions));
|
||||
|
||||
/*
|
||||
* If not publishable, it publishes no actions. (pgoutput_change() will
|
||||
* ignore it.)
|
||||
*/
|
||||
if (!is_publishable_relation(relation))
|
||||
return pubactions;
|
||||
|
||||
if (relation->rd_pubactions)
|
||||
return memcpy(pubactions, relation->rd_pubactions,
|
||||
sizeof(PublicationActions));
|
||||
|
Reference in New Issue
Block a user