Re: [HACKERS] "create publication..all tables" ignore 'partition notsupported' error - Mailing list pgsql-hackers

From Kuntal Ghosh
Subject Re: [HACKERS] "create publication..all tables" ignore 'partition notsupported' error
Date
Msg-id CAGz5QCJj-ebKXfVMncN7mFnTjJ8PFbRAVEss55NtJv+PMxAsjg@mail.gmail.com
Whole thread Raw
In response to [HACKERS] "create publication..all tables" ignore 'partition not supported'error  (tushar <tushar.ahuja@enterprisedb.com>)
Responses Re: [HACKERS] "create publication..all tables" ignore 'partition notsupported' error
List pgsql-hackers
Yeah, it's a bug. While showing the table definition, we use the
following query for showing the related publications:
"SELECT pub.pubname\n"                             " FROM pg_catalog.pg_publication pub\n"
"LEFT JOIN pg_catalog.pg_publication_rel pr\n"                             "      ON (pr.prpubid = pub.oid)\n"
                  "WHERE pr.prrelid = '%s' OR pub.puballtables\n"                             "ORDER BY 1;"
 

When pub.puballtables is TRUE, we should also check whether the
relation is publishable or not.(Something like is_publishable_class
method in pg_publication.c).

However, I'm not sure whether this is the correct way to solve the problem.

On Mon, May 22, 2017 at 2:39 PM, tushar <tushar.ahuja@enterprisedb.com> wrote:
> Hi,
>
> I observed that - "create publication..all tables" ignore 'partition not
> supported' error
>
> \\create a partition table
>
> You are now connected to database "s" as user "centos".
> s=# CREATE TABLE measurement (
> s(#     city_id         int not null,
> s(#     logdate         date not null,
> s(#     peaktemp        int,
> s(#     unitsales       int
> s(# ) PARTITION BY RANGE (logdate);
> CREATE TABLE
> s=#
>
> \\try to publish only this table
>
> s=# create publication p for table  measurement;
> ERROR:  "measurement" is a partitioned table
> DETAIL:  Adding partitioned tables to publications is not supported.
> HINT:  You can add the table partitions individually.
>
> \\try to create publication for all tables
> s=# create publication p for all tables ;
> CREATE PUBLICATION
> s=# \d+ measurement
>                                  Table "public.measurement"
>   Column   |  Type   | Collation | Nullable | Default | Storage | Stats
> target | Description
> -----------+---------+-----------+----------+---------+---------+--------------+-------------
>  city_id   | integer |           | not null |         | plain |
> |
>  logdate   | date    |           | not null |         | plain |
> |
>  peaktemp  | integer |           |          |         | plain |
> |
>  unitsales | integer |           |          |         | plain |
> |
> Partition key: RANGE (logdate)
> Publications:
>     "p"
>
> Publication 'p' has been set against partition table ,which is not
> supported.
>
> --
> regards,tushar
> EnterpriseDB  https://www.enterprisedb.com/
> The Enterprise PostgreSQL Company
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers



-- 
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: tushar
Date:
Subject: [HACKERS] pg_dump ignoring information_schema tables which used in CreatePublication.
Next
From: Albe Laurenz
Date:
Subject: [HACKERS] Index created in BEFORE trigger not updated during INSERT