[BUGS] BUG #14771: "Logical decoding" does not cover the impact of "TRUNCATETABLE" command - Mailing list pgsql-bugs

From hillel.eilat@attunity.com
Subject [BUGS] BUG #14771: "Logical decoding" does not cover the impact of "TRUNCATETABLE" command
Date
Msg-id 20170807122030.8422.9419@wrigleys.postgresql.org
Whole thread Raw
Responses Re: [BUGS] BUG #14771: "Logical decoding" does not cover the impactof "TRUNCATE TABLE" command
Re: [BUGS] BUG #14771: "Logical decoding" does not cover the impactof "TRUNCATE TABLE" command
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14771
Logged by:          Hillel Eilat
Email address:      hillel.eilat@attunity.com
PostgreSQL version: 9.4.4
Operating system:   Windows 7
Description:


I work on a mission of synchronizing data between PostgreSQL database and a
"foreign" target database of choice.
A simple SQL based "Logical Decoding" framework is used for capturing
"INSERT,UPDATE,DELETE" operations which are applied on the PostgreSQL
side.
These are applied onto the target DB thereafter - thus - both sides remain
intact with respect to their data contents.
Yet - this synchronization pattern does not cover the case of "TRUNCATE
TABLE" command.
From "Logical Decoding" perspective - "TRUNCATE TABLE" is logically
equivalent to "DELETE FROM TABLE".
Both affect the contents of the PostgreSQL database identically.
However - "DELETE FROM TABLE" will be reflected at the target database
properly - as expected - while "TRUNCATE" will NOT!!.
"Logical Decoding" aims to cover ALL changes made onto data in a coherent
fashion.
"TRUNCATE" stands for a case where change in data contents at PostgreSQL are
not handled by "Logical Decoding", hence synchronization is not achieved.
Did I miss something?
Is it the only case?
How can one cope with this deficiency?

Regards

Hillel.



--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Jaimin Pan
Date:
Subject: [BUGS] Error of insert Foreign table with postgres_fdw
Next
From: Euler Taveira
Date:
Subject: Re: [BUGS] BUG #14771: "Logical decoding" does not cover the impactof "TRUNCATE TABLE" command