pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hillel.eilat@attunity.com
To: pgsql-bugs@postgresql.org
Cc: hillel.eilat@attunity.com
Subject: BUG #14771: "Logical decoding" does not cover the impact of "TRUNCATE TABLE" command
Date: Mon, 07 Aug 2017 12:20:30 +0000
Message-ID: <20170807122030.8422.9419@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


view thread (5+ messages)  latest in thread

Message-ID: <20170807122030.8422.9419@wrigleys.postgresql.org>
Permalink:  ../20170807122030.8422.9419@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170807122030.8422.9419@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hillel.eilat@attunity.com
  Subject: Re: BUG #14771: "Logical decoding" does not cover the impact of "TRUNCATE TABLE" command
  In-Reply-To: <20170807122030.8422.9419@wrigleys.postgresql.org>
  References: <20170807122030.8422.9419@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox