Disallow SET UNLOGGED for tables in a publication's EXCEPT clause.

Unlogged tables cannot be replicated, so they can neither be published nor
be named in a publication's EXCEPT clause.  ALTER TABLE ... SET UNLOGGED
checked only whether the table was published, so a table in an EXCEPT
clause could still be made unlogged, leaving a state that CREATE
PUBLICATION would reject and that pg_dump could not restore.

Author: Vignesh C <[email protected]>
Reviewed-by: Amit Kapila <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: shveta malik <[email protected]>
Reviewed-by: Hayato Kuroda <[email protected]>
Reviewed-by: Peter Smith <[email protected]>
Reviewed-by: Zhijie Hou <[email protected]>
Discussion: 
https://postgr.es/m/caldanm1r2mkgu6h8zgu1kj1sx-fcmq7wgtelsnhx-5joiyx...@mail.gmail.com
Backpatch-through: 19, where it was introduced

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7056ed4663f5ce4214cc1ebce42ec40f4400a7ea

Modified Files
--------------
src/backend/catalog/pg_publication.c      | 19 +++++++++++++++++++
src/backend/commands/tablecmds.c          | 13 +++++++------
src/include/catalog/pg_publication.h      |  1 +
src/test/regress/expected/publication.out | 10 ++++++++++
src/test/regress/sql/publication.sql      |  8 ++++++++
5 files changed, 45 insertions(+), 6 deletions(-)

Reply via email to