Fwd: Detecting renamed columns via pgouput in logical replication ?

From: Andreas Andreakis <andreas(dot)andreakis(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Fwd: Detecting renamed columns via pgouput in logical replication ?
Date: 2020-04-27 05:40:08
Message-ID: CAFtXTgvAZ+NQFsKb3UcoW_50+vAQXvsVb30fMAxf05YfZi7aQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-general

Hello,

re-posting question to the dev mailing list, since no reply received in the
general mailing list. This mailing list also seems a better place for this
question. See below for the original mail.

thx

---------- Forwarded message ---------
From: Andreas Andreakis <andreas(dot)andreakis(at)gmail(dot)com>
Date: Thu, Apr 16, 2020 at 9:22 PM
Subject: Detecting renamed columns via pgouput in logical replication ?
To: <pgsql-general(at)lists(dot)postgresql(dot)org>

Hello,

when using Postgres 10 or higher, it seems that pgoutput can be used as an
output plugin for logical replication.

Does this allow to detect column renames ? Or is there a ticket for adding
support if the feature does not exist (if it is feasible to implement) ?

https://www.postgresql.org/docs/10/protocol-logicalrep-message-formats.html
should
be the format spec of pgoutput and it does not seem to contain sufficient
information for detecting renames. Also checked for Postgres version 11 and
12.

What I was hoping to find is the ordinal position of columns and use that
to infer column renames. As new columns always get a higher ordinal
position and renamed columns keep their position. Hence, a column rename
could be detected if different column names are received for the same
ordinal position, by tracking the column name per ordinal position at the
consumer. (Please let me know if any of that is incorrect)

cheers

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2020-04-27 06:02:32 pgsql: Fix some typos
Previous Message Tom Lane 2020-04-26 15:45:58 pgsql: Doc: improve documentation of websearch_to_tqsuery().

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2020-04-27 06:03:09 Re: Detecting renamed columns via pgouput in logical replication ?
Previous Message Tom Browder 2020-04-26 01:36:56 Re: Binary downloads and upgrading the host OS