From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pranav Hegde <pranavh4@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PgOutput Replication Message Format - Differentiate between explicit NULL and Omitted Columns during Insert
Date: Wed, 05 Apr 2023 10:24:45 -0400
Message-ID: <1834632.1680704685@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEMfXBc3=SNLCGLxX3TzrRtX3CZjQOSzBO04585_dun826CqQg@mail.gmail.com>
References: <CAEMfXBc3=SNLCGLxX3TzrRtX3CZjQOSzBO04585_dun826CqQg@mail.gmail.com>
Pranav Hegde <pranavh4@gmail.com> writes:
> Currently in the PgOutput messages for Insert statements, there is no way
> to differentiate if the column was explicitly set to null in the insert
> statement, or whether that column was omitted in the insert statement and
> thus set to null (or default value)
Nope. Replication works at the data level, it has no idea how that
data was formed originally.
> Thus we are not able to identify which column was explicitly set to null
> and which column was set to the default value.
> This causes issues when we are parsing the message, especially in libraries
> such as Debezium, where it returns the default value for the column, even
> though in the actual SQL query we set that column to be explicitly null.
If you have code that changes the data supplied, that code is wrong.
We are not likely to change the replication protocol to support it.
regards, tom lane
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, pranavh4@gmail.com
Subject: Re: PgOutput Replication Message Format - Differentiate between explicit NULL and Omitted Columns during Insert
In-Reply-To: <1834632.1680704685@sss.pgh.pa.us>
References: <CAEMfXBc3=SNLCGLxX3TzrRtX3CZjQOSzBO04585_dun826CqQg@mail.gmail.com> <1834632.1680704685@sss.pgh.pa.us>
* 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