On Tue, 17 Nov 2026 at 17:34, <[email protected]> wrote: > > The patch also adds tests for domain NOT NULL and CHECK constraints in > text and binary modes, along with key updates, unchanged TOAST values > and subscriber-only defaults. The full subscription test suite passed > with the patch. > > I'm not sure if this is the right way to fix it, or if there are cases > I've missed. I'd appreciate your thoughts on the approach. If it looks > reasonable, I can continue to improve the patch and add more tests.
Thanks for the patch. The issue is fixed only when the publisher sends values for the NOT NULL domain columns. However, if the publisher does not have the column and the subscriber needs to assign its default value, the NOT NULL constraint is not validated. Here is a test for the same: --pub CREATE TABLE tab_req (a int PRIMARY KEY); INSERT INTO tab_req (a) VALUES (1) CREATE PUBLICATION pub1 FOR TABLE tab_req; --sub CREATE DOMAIN required_int AS int NOT NULL; CREATE TABLE tab_req (a int PRIMARY KEY, extra required_int); --subscriber insert fails INSERT INTO tab_req (a) VALUES (1) --sub CREATE SUBSCRIPTION orders_subscription CONNECTION '<publisher connection string>' PUBLICATION pub1 WITH (disable_on_error = true); -- sub postgres=# select * from tab_req ; a | extra ---+------- 1 | (1 row) Should we call domain_check to see if the domain type does not allow null values in these cases? Regards, Vignesh
