Re: [HACKERS] Logical decoding truncate

Поиск
Список
Период
Сортировка
От Euler Taveira
Тема Re: [HACKERS] Logical decoding truncate
Дата
Msg-id CAHE3wghw80TwbfS+f1FQ07Gp9FhjMBjH4fCGwHmgkVuLC5Ds9A@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] Logical decoding truncate  ("Friedrich, Steffen" <Steffen.Friedrich@dieboldnixdorf.com>)
Список pgsql-hackers
2017-05-11 4:23 GMT-03:00 Friedrich, Steffen <Steffen.Friedrich@dieboldnixdorf.com>:

I am writing a logical decoding output plugin decoding WAL to SQL which is finally applied to target database.

 

Is it possible to decode a TRUNCATE statement and the tables involved? 


Yes, use event triggers. You can decode whatever DDL command you want.
 

Assuming the SQL statement "TRUNCATE x, y;",  I am interested in decoding the operation TRUNCATE and the corresponding tables x and y so that I can reconstruct the SQL statement/transaction.

Is that possible?

If so, can you please provide an example or point me into the right direction?

 

Take a look at BDR code (bdr_queue_ddl_commands and bdr_queue_dropped_objects) [1]. It implements DDL replication too.
--
   Euler Taveira                                   Timbira - http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Cached plans and statement generalization
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Cached plans and statement generalization