pgsql: Extend pg_publication_tables to display column list and row filt

Started by Amit Kapilaabout 4 years ago5 messagescomitters
Jump to latest
#1Amit Kapila
amit.kapila16@gmail.com

Extend pg_publication_tables to display column list and row filter.

Commit 923def9a53 and 52e4f0cd47 allowed to specify column lists and row
filters for publication tables. This commit extends the
pg_publication_tables view and pg_get_publication_tables function to
display that information.

This information will be useful to users and we also need this for the
later commit that prohibits combining multiple publications with different
column lists for the same table.

Author: Hou Zhijie
Reviewed By: Amit Kapila, Alvaro Herrera, Shi Yu, Takamichi Osumi
Discussion: /messages/by-id/202204251548.mudq7jbqnh7r@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0ff20288e1cb3282efb43401896a939916fceb4d

Modified Files
--------------
doc/src/sgml/catalogs.sgml | 27 +++++++++++++--
src/backend/catalog/pg_publication.c | 54 +++++++++++++++++++++++++++--
src/backend/catalog/system_views.sql | 10 +++++-
src/backend/replication/logical/tablesync.c | 14 +++-----
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 8 ++---
src/test/regress/expected/publication.out | 42 +++++++++++-----------
src/test/regress/expected/rules.out | 13 +++++--
8 files changed, 126 insertions(+), 44 deletions(-)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Amit Kapila (#1)
Re: pgsql: Extend pg_publication_tables to display column list and row filt

Amit Kapila <akapila@postgresql.org> writes:

Extend pg_publication_tables to display column list and row filter.

Is this really something to be doing post-beta1?

This information will be useful to users and we also need this for the
later commit that prohibits combining multiple publications with different
column lists for the same table.

I'm very skeptical of any claim that system view contents should be
involved in such a prohibition.

regards, tom lane

#3Amit Kapila
amit.kapila16@gmail.com
In reply to: Tom Lane (#2)
Re: pgsql: Extend pg_publication_tables to display column list and row filt

On Thu, May 19, 2022 at 8:40 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Amit Kapila <akapila@postgresql.org> writes:

Extend pg_publication_tables to display column list and row filter.

Is this really something to be doing post-beta1?

I am sorry if we don't allow to make catalog changes post-beta1. If we
can't do that then I can revert this and try to find a different
solution to the problem?

This information will be useful to users and we also need this for the
later commit that prohibits combining multiple publications with different
column lists for the same table.

I'm very skeptical of any claim that system view contents should be
involved in such a prohibition.

That is not the only way for such a prohibition but it appeared
simpler to do that way as we are already using that view and its
underlying function (pg_get_publication_tables) in the place where
prohibition has to be added.

--
With Regards,
Amit Kapila.

#4Andres Freund
andres@anarazel.de
In reply to: Amit Kapila (#3)
Re: pgsql: Extend pg_publication_tables to display column list and row filt

Hi,

On 2022-05-19 08:59:13 +0530, Amit Kapila wrote:

On Thu, May 19, 2022 at 8:40 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Amit Kapila <akapila@postgresql.org> writes:

Extend pg_publication_tables to display column list and row filter.

Is this really something to be doing post-beta1?

I am sorry if we don't allow to make catalog changes post-beta1.

I don't think there's a hard prohibition of catalog changes. But we should be
careful doing them because it makes testing more painful etc.

If we can't do that then I can revert this and try to find a different
solution to the problem?

What "problem"? This just seems like a feature in a problem's clothing? The
commit message says:

This information will be useful to users and we also need this for the
later commit that prohibits combining multiple publications with different
column lists for the same table.

which doesn't at all strike me as a justification for committing it post
feature freeze, i.e. it sounds like a feature.

If you want to argue that it's a rough corner in v15 work, that it's worth
committing now, do that explicitly.

Greetings,

Andres Freund

#5Amit Kapila
amit.kapila16@gmail.com
In reply to: Andres Freund (#4)
Re: pgsql: Extend pg_publication_tables to display column list and row filt

On Sun, May 29, 2022 at 2:00 AM Andres Freund <andres@anarazel.de> wrote:

Hi,

On 2022-05-19 08:59:13 +0530, Amit Kapila wrote:

On Thu, May 19, 2022 at 8:40 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Amit Kapila <akapila@postgresql.org> writes:

Extend pg_publication_tables to display column list and row filter.

Is this really something to be doing post-beta1?

I am sorry if we don't allow to make catalog changes post-beta1.

I don't think there's a hard prohibition of catalog changes. But we should be
careful doing them because it makes testing more painful etc.

I agree. In this case, it seemed like a better way to solve the
problem at hand. I have tried to explain the problem in -hackers
thread at [1]/messages/by-id/CAA4eK1KrXS0js9S0YFQRh9Vf5kaVOyz=NqA=0vMHvF1kxUJVkA@mail.gmail.com and the latest patch (which required the change in this
commit) for it is posted in email [2]/messages/by-id/OS0PR01MB5716FFBE5AACA8707C3420E994D89@OS0PR01MB5716.jpnprd01.prod.outlook.com. Can you please once check that?

[1]: /messages/by-id/CAA4eK1KrXS0js9S0YFQRh9Vf5kaVOyz=NqA=0vMHvF1kxUJVkA@mail.gmail.com
[2]: /messages/by-id/OS0PR01MB5716FFBE5AACA8707C3420E994D89@OS0PR01MB5716.jpnprd01.prod.outlook.com

--
With Regards,
Amit Kapila.