1
0
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:
Peter Eisentraut
2019-04-16 10:37:44 +02:00
parent 1cebfdee00
commit bb385c4fb0
2 changed files with 43 additions and 1 deletions

View File

@ -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));