Fix handling of unlogged tables in FOR ALL TABLES publications

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Fix handling of unlogged tables in FOR ALL TABLES publications
Дата
Msg-id f3f151f7-c4dd-1646-b998-f60bd6217dd3@2ndquadrant.com
обсуждение исходный текст
Ответы Re: Fix handling of unlogged tables in FOR ALL TABLES publications
Список 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

Вложения

В списке pgsql-hackers по дате отправления: