Thread: Logical Replication - Adding Not-Null Column Without Default Value
Hi Experts,
I'm using logical replication with Postgres 15.
I added not-null column without default value to one of my published tables. The way I so it on publisher side is to add the column as nullable, then update the value based on some logic, and finally make the column not-null.
On the subscriber side, if add the column as nullable then add dummy value and finally make it not-null (all in a single truncation), will it be safe to say that the correct values of this column will be logically synchronized from publisher to subscriber and will override the dummy values. Would, at the end, the two tables on publisher and subscriber have exactly the same values for this column.
Do you see a scenario that the tables will not be the same? Is there a better way to add a not-null column without default value on subscriber side?
Thanks