Thread

  1. Re: DOCS - CREATE PUBLICATION ... EXCEPT has no mention on what happens after drop/create tables

    Amit Kapila <amit.kapila16@gmail.com> — 2026-05-11T04:25:27Z

    On Sun, May 10, 2026 at 8:32 PM SATYANARAYANA NARLAPURAM
    <satyanarlapuram@gmail.com> wrote:
    >
    > The docs say EXCEPT "This clause specifies a list of tables to be excluded from the publication. "
    > with no time qualifier. In case of drop/create the table automatically includes in the publication. Given the
    > filter is based on OIDs this is expected. Should we enhance the documentation to mention this case?
    >
    
    The behavior is the same for the explicit INCLUDE publications as
    well. For example, dropping and re-creating tables won't make it part
    of publication automatically.
    
    postgres=# create table inc_t(c1 int, c2 int, c3 int);
    CREATE TABLE
    postgres=# create publication pub_inc for table inc_t;
    CREATE PUBLICATION
    postgres=# select * from pg_publication_tables;
     pubname | schemaname | tablename |  attnames  | rowfilter
    ---------+------------+-----------+------------+-----------
     pub_inc | public     | inc_t     | {c1,c2,c3} |
    (1 row)
    postgres=# drop table inc_t;
    DROP TABLE
    postgres=# create table inc_t(c1 int, c2 int, c3 int);
    CREATE TABLE
    postgres=# select * from pg_publication_tables;
     pubname | schemaname | tablename | attnames | rowfilter
    ---------+------------+-----------+----------+-----------
    (0 rows)
    
    You can see after drop/create, the table is no longer part of
    publication. The same happens for the EXCLUDE case, so I don't see the
    need for additional docs to explain this behavior. OTOH, if this
    behavior was not obvious to you or you got some such question from the
    users of this feature then feel free to propose a docs patch.
    
    -- 
    With Regards,
    Amit Kapila.