Re: why can't a table be part of the same publication as its schema - Mailing list pgsql-hackers

From Mark Dilger
Subject Re: why can't a table be part of the same publication as its schema
Date
Msg-id 917B3A3D-AEA5-4613-88D8-08155DA28CB5@enterprisedb.com
Whole thread Raw
In response to Re: why can't a table be part of the same publication as its schema  (Robert Haas <robertmhaas@gmail.com>)
Responses RE: why can't a table be part of the same publication as its schema
List pgsql-hackers

> On Sep 10, 2022, at 4:17 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>
>>> I don't understand why we
>>> used this ALL TABLES IN SCHEMA language.
>>
>> The conversation, as I recall, was that "ADD SCHEMA foo" would only mean all tables in foo, until publication of
otherobject types became supported, at which point "ADD SCHEMA foo" would suddenly mean more than it did before.
Peoplemight find that surprising, so the "ALL TABLES IN" was intended to future-proof against surprising behavioral
changes.
>
> If I encountered this syntax in a vacuum, that's not what I would
> think. I would think that ADD ALL TABLES IN SCHEMA meant add all the
> tables in the schema to the publication one by one as individual
> objects

Yes, it appears the syntax was chosen to avoid one kind of confusion, but created another kind.  Per the docs on this
feature:

  FOR ALL TABLES IN SCHEMA
  Marks the publication as one that replicates changes for all tables in the specified list of schemas, including
tablescreated in the future. 

Like you, I wouldn't expect that definition, given the behavior of GRANT with respect to the same grammatical
construction.

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] initdb: do not exit after warn_on_mount_point
Next
From: Tom Lane
Date:
Subject: Re: Splitting up guc.c