Re: why can't a table be part of the same publication as its schema

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Subject: Re: why can't a table be part of the same publication as its schema
Date: 2022-09-21 17:16:29
Message-ID: CAA4eK1+Zv5nX+0qUwnZxqi=Y-EAMCQfPCMmsnd_HmBR--Y13ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 21, 2022 at 8:24 PM Jonathan S. Katz <jkatz(at)postgresql(dot)org> wrote:
>
> On 9/21/22 10:24 AM, Alvaro Herrera wrote:
> > On 2022-Sep-20, Robert Haas wrote:
> >
> >>> I don't think we should change this behavior that's already in logical
> >>> replication. While I understand the reasons why "GRANT ... ALL TABLES IN
> >>> SCHEMA" has a different behavior (i.e. it's not applied to future
> >>> objects) and do not advocate to change it, I have personally been
> >>> affected where I thought a permission would be applied to all future
> >>> objects, only to discover otherwise. I believe it's more intuitive to
> >>> think that "ALL" applies to "everything, always."
> >>
> >> Nah, there's room for multiple behaviors here. It's reasonable to want
> >> to add all the tables currently in the schema to a publication (or
> >> grant permissions on them) and it's reasonable to want to include all
> >> current and future tables in the schema in a publication (or grant
> >> permissions on them) too. The reason I don't like the ALL TABLES IN
> >> SCHEMA syntax is that it sounds like the former, but actually is the
> >> latter. Based on your link to the email from Tom, I understand now the
> >> reason why it's like that, but it's still counterintuitive to me.
> >
> > I already proposed elsewhere that we remove the ALL keyword from there,
> > which I think serves to reduce confusion (in particular it's no longer
> > parallel to the GRANT one). As in the attached.
>

Thanks for working on this.

> [personal, not RMT hat]
>
> I'd be OK with this. It would still allow for "FOR SEQUENCES IN SCHEMA" etc.
>

I also think this is reasonable. It can later be extended to have an
option to exclude/include future tables with a publication option.
Also, if we want to keep it compatible with FOR ALL TABLES syntax, we
can later add ALL as an optional keyword in the syntax.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-09-21 17:56:37 Re: [RFC] building postgres with meson - v13
Previous Message Zheng Li 2022-09-21 16:55:35 Re: Support logical replication of DDLs