Re: row filtering for logical replication

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: row filtering for logical replication
Дата
Msg-id 202107141452.edncq4ot5zkg@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: row filtering for logical replication  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Ответы Re: row filtering for logical replication
Список pgsql-hackers
On 2021-Jul-14, Tomas Vondra wrote:

> The way I'm thinking about this is that for INSERT and DELETE it's clear
> which row version should be used (because there's just one). And for UPDATE
> we could see that as DELETE + INSERT, and apply the same rule to each
> action.
> 
> On the other hand, I can imagine cases where it'd be useful to send the
> UPDATE when the old row matches the condition and new row does not.

In any case, it seems to me that the condition expression should be
scanned to see which columns are used in Vars (pull_varattnos?), and
verify if those columns are in the REPLICA IDENTITY; and if they are
not, raise an error.  Most of the time the REPLICA IDENTITY is going to
be the primary key; but if the user wants to use other columns in the
expression, we can HINT that they can set REPLICA IDENTITY FULL.

-- 
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/
<Schwern> It does it in a really, really complicated way
<crab> why does it need to be complicated?
<Schwern> Because it's MakeMaker.



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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: row filtering for logical replication
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: row filtering for logical replication