Thread: pgsql: Extend pg_publication_tables to display column list and row filt
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: https://postgr.es/m/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(-)
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
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.
Re: pgsql: Extend pg_publication_tables to display column list and row filt
From
Andres Freund
Date:
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
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] and the latest patch (which required the change in this commit) for it is posted in email [2]. Can you please once check that? [1] - https://www.postgresql.org/message-id/CAA4eK1KrXS0js9S0YFQRh9Vf5kaVOyz%3DNqA%3D0vMHvF1kxUJVkA%40mail.gmail.com [2] - https://www.postgresql.org/message-id/OS0PR01MB5716FFBE5AACA8707C3420E994D89%40OS0PR01MB5716.jpnprd01.prod.outlook.com -- With Regards, Amit Kapila.