Re: Logical Replication - Should Destination Table Columns Be Defined With Default Value

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Logical Replication - Should Destination Table Columns Be Defined With Default Value
Дата
Msg-id CAKFQuwaTLveZQjeo+yPMkWBM=J_2rW5Z120ZdMGHiCVW=bUW0g@mail.gmail.com
обсуждение исходный текст
Ответ на Logical Replication - Should Destination Table Columns Be Defined With Default Value  (Avi Weinberg <AviW@gilat.com>)
Ответы RE: Logical Replication - Should Destination Table Columns Be Defined With Default Value
Re: Logical Replication - Should Destination Table Columns Be Defined With Default Value
Список pgsql-general
On Tue, Nov 9, 2021 at 7:50 AM Avi Weinberg <AviW@gilat.com> wrote:

Was this done on purpose, that default value for new column is not copied for existing data?  Does this mean that on destination side we must also define the table with default value? 


Logical replication has two modes, initial synchronization and ongoing change push.  The ongoing change push sends entire rows, when they change, from the publisher to subscriber.

The initial sync happens once, when the subscriber initially subscribes to the publication.

As entire rows are getting sent, defaults on the subscriber are immaterial so far as the published rows are concerned.

If you run a command on the publisher that causes every row to change then of course every row will be published with those new values to the subscriber.

David J.

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

Предыдущее
От: Avi Weinberg
Дата:
Сообщение: Logical Replication - Should Destination Table Columns Be Defined With Default Value
Следующее
От: Avi Weinberg
Дата:
Сообщение: RE: Logical Replication - Should Destination Table Columns Be Defined With Default Value