Hi Shlok.

FYI, I tested that the exclusion of a SEQUENCE follows the sequence
object around the same as a table excluded from FOR ALL TABLES does.

> 1.
> The recent commit 77b6dd9 added some more information to say:
>
> ---
> Once a table is excluded, the exclusion applies to that table
> regardless of its name or schema. Renaming the table or moving it to
> another schema using <command>ALTER TABLE ... SET SCHEMA</command> does
> not remove the exclusion.
> ---
>
> 1a
> AFAIK this same rule (the exclusion follows the object regardless of
> the schema) is going to apply also for excluding sequences. So, the
> docs should be updated to say something similar about behaviour for
> sequences.
>
> ~
>
> 1b.
> Maybe you need to add another test case to exclude some sequence, then
> alter the sequence's schema, then verify that the moved sequence is
> still excluded.
>

test_pub=# CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT (TABLE
PUBT1), ALL SEQUENCES EXCEPT (SEQUENCE PUBSEQ);
CREATE PUBLICATION

test_pub=# \dRp+ pub1
                                                       Publication pub1
  Owner   | All tables | All sequences | Inserts | Updates | Deletes |
Truncates | Generated columns | Via root | Descri
ption
----------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+-------
------
 postgres | t          | t             | t       | t       | t       |
t         | none              | f        |
Except tables:
    "public.pubt1"
Except sequences:
    "public.pubseq"

-- Now move the excluded sequence to another schema and see that it is
still excluded

test_pub=# alter sequence pubseq set schema myschema;
ALTER SEQUENCE
test_pub=# \dRp+ pub1
                                                       Publication pub1
  Owner   | All tables | All sequences | Inserts | Updates | Deletes |
Truncates | Generated columns | Via root | Descri
ption
----------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+-------
------
 postgres | t          | t             | t       | t       | t       |
t         | none              | f        |
Except tables:
    "public.pubt1"
Except sequences:
    "myschema.pubseq"

-- Now rename the excluded sequence and see that it is still excluded

test_pub=# alter sequence myschema.pubseq rename to pubseq2;
ALTER SEQUENCE
test_pub=# \dRp+ pub1
                                                       Publication pub1
  Owner   | All tables | All sequences | Inserts | Updates | Deletes |
Truncates | Generated columns | Via root | Descri
ption
----------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+-------
------
 postgres | t          | t             | t       | t       | t       |
t         | none              | f        |
Except tables:
    "public.pubt1"
Except sequences:
    "myschema.pubseq2"

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


Reply via email to