Re: "create publication..all tables" ignore 'partition not supported' error

From: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
To: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: "create publication..all tables" ignore 'partition not supported' error
Date: 2017-05-22 11:02:21
Message-ID: CAGz5QCJj-ebKXfVMncN7mFnTjJ8PFbRAVEss55NtJv+PMxAsjg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)ahuja(at)enterprisedb(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2017-05-22 11:05:14 Index created in BEFORE trigger not updated during INSERT
Previous Message tushar 2017-05-22 10:52:32 pg_dump ignoring information_schema tables which used in Create Publication.