Re: Support EXCEPT for TABLES IN SCHEMA publications

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications
Date: 2026-04-29 05:45:57
Message-ID: CAHut+PtDSmaRRA2tjB6_D_EdsDqPEuhR-83W5tK7d_pO2rqUDg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Nisha.

Some review comments for v4-0001 (docs only).

======
doc/src/sgml/ref/create_publication.sgml

1.
+ TABLES IN SCHEMA { <replaceable
class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [
EXCEPT ( <replaceable
class="parameter">except_table_object</replaceable> [, ... ] ) ] [,
... ]

It is ambiguous which part does that last ellipsis applies to?

Consider instead:

TABLES IN SCHEMA tables_in_schema [, ... ]

and tables_in_schema is:
{ schema_name | CURRENT_SCHEMA } [ EXCEPT ( except_table_object [, ... ] ) ]

~~~

2.
<para>
This clause specifies a list of tables to be excluded from the
- publication.
+ publication. It can be used with both <literal>FOR ALL TABLES</literal>
+ and <literal>FOR TABLES IN SCHEMA</literal>.
</para>

Saying "both" may imply they can coexist, but they cannot.

SUGGESTION
It can be used with <literal>FOR ALL TABLES</literal> or <literal>FOR
TABLES IN SCHEMA</literal>.

~~~

3.
+ <para>
+ Create a publication that publishes all changes for all the tables
present in
+ the schema <structname>sales</structname>, except
+ <structname>sales.internal</structname> and
<structname>sales.drafts</structname>:
+<programlisting>
+CREATE PUBLICATION sales_filtered FOR TABLES IN SCHEMA sales EXCEPT
(TABLE sales.internal, sales.drafts);
+</programlisting>
+ </para>
+

AFAIK, the tables in the EXCEPT clause do not need to be
schema-qualified, so they should not be written that way in the
programlisting part of this example, because it might give the user
the impression that schema-qualified names are required.

======
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-04-29 05:50:48 Re: Parallel Apply
Previous Message John Naylor 2026-04-29 05:04:48 Re: [BUG?] macOS (Intel) build warnings: "ranlib: file … has no symbols" for aarch64 objects