Logical Replication - Adding Not-Null Column Without Default Value

Поиск
Список
Период
Сортировка
От Avi Weinberg
Тема Logical Replication - Adding Not-Null Column Without Default Value
Дата
Msg-id DB9PR07MB718081ECF085D13491D1CAA0CBD6A@DB9PR07MB7180.eurprd07.prod.outlook.com
обсуждение исходный текст
Список pgsql-general

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

 

IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person.

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

Предыдущее
От: Ron
Дата:
Сообщение: Re: PITR partial timing
Следующее
От: Dominique Devienne
Дата:
Сообщение: Parsing libpq PQtrace files