Re: Support logical replication of DDLs - Mailing list pgsql-hackers

From li jie
Subject Re: Support logical replication of DDLs
Date
Msg-id CAGfChW7-qMXzgVH18b1vpetXV1A8-M0g7VHPwqyRbb9YarTtRA@mail.gmail.com
Whole thread Raw
In response to Re: Support logical replication of DDLs  (Zheng Li <zhengli10@gmail.com>)
List pgsql-hackers

All three commands are captured by the event trigger. The first and
second command ends up getting deparsed, WAL-logged and
replayed on the subscriber. The replay of the ALTER TABLE command
causes a duplicate constraint error. The problem is that
while subcommands are captured by event triggers by default, they
don't need to be deparsed and WAL-logged for DDL replication.
To do that we can pass the isCompleteQuery variable in
ProcessUtilitySlow to EventTriggerCollectSimpleCommand() and
EventTriggerAlterTableEnd() and make this information available in
CollectedCommand so that any subcommands can be skipped. 

May not be able to skip any subcommands.

like ' ALTER TABLE  ctlt1_like ALTER COLUMN b SET STORAGE EXTERNAL;'

It cannot be represented in the CREATE TABLE  statement.


Regards,  Adger

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Remove a unused argument from qual_is_pushdown_safe
Next
From: Zheng Li
Date:
Subject: Re: Support logical replication of DDLs