aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-04-16 10:37:44 +0200
committerPeter Eisentraut <peter@eisentraut.org>2019-04-18 08:55:55 +0200
commitbb385c4fb0f4eb33d2bc7e484061565ba51cc790 (patch)
tree6a96c37b2ae14bec7602eafcaabecc5c22261ed9 /src/backend/utils/cache/relcache.c
parent1cebfdee0087624af2fc99a000642c2db4dfbfc9 (diff)
downloadpostgresql-bb385c4fb0f4eb33d2bc7e484061565ba51cc790.tar.gz
postgresql-bb385c4fb0f4eb33d2bc7e484061565ba51cc790.zip
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
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r--src/backend/utils/cache/relcache.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 4b884d55278..bab59f16e68 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -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));