> 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