Fix handling of unlogged tables in FOR ALL TABLES publications - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Fix handling of unlogged tables in FOR ALL TABLES publications
Date
Msg-id f3f151f7-c4dd-1646-b998-f60bd6217dd3@2ndquadrant.com
Whole thread Raw
Responses Re: Fix handling of unlogged tables in FOR ALL TABLES publications
List pgsql-hackers
If a FOR ALL TABLES publication exists, 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.  That is useless, so check first whether the given
table is publishable and skip the check if not.

Example:

CREATE PUBLICATION pub FOR ALL TABLES;
CREATE UNLOGGED TABLE logical_replication_test AS SELECT 1 AS number;
UPDATE logical_replication_test SET number = 2;
ERROR:  cannot update table "logical_replication_test" because it does
not have a replica identity and publishes updates

Patch attached.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Use nanosleep(2) in pg_usleep, if available?
Next
From: Robert Haas
Date:
Subject: Re: performance issue in remove_from_unowned_list()