pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: houzj.fnst@fujitsu.com <houzj.fnst@fujitsu.com>
To: vignesh C <vignesh21@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: why can't a table be part of the same publication as its schema
Date: Wed, 14 Sep 2022 21:36:37 +0200
Message-ID: <b2ffd236-fefd-f8f8-05a0-dc603e5a2bae@enterprisedb.com> (raw)
In-Reply-To: <OS0PR01MB571613363874441516C5BBCC94469@OS0PR01MB5716.jpnprd01.prod.outlook.com>
References: <2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e@enterprisedb.com>
	<CAA4eK1KDX2S1bct1-y_dXpV3VpYU5CotU9MN57uzPOSWEararQ@mail.gmail.com>
	<37271.1662704091@sss.pgh.pa.us>
	<CAA4eK1JPPQ1j=m15QCvU2Yfdq70yVhZejpvPi27GaVD4urWAgA@mail.gmail.com>
	<CA+TgmoZOE9uDzjiLBi_8yqVcqrfMYfvp02DLF1fFzOR9Zp4txg@mail.gmail.com>
	<OS0PR01MB5716FA725E51EF7F130E59AC94439@OS0PR01MB5716.jpnprd01.prod.outlook.com>
	<CA+Tgmoaf=vvTZug0nT8ihti1jvLXnvSaRj1osLjVjmKwQTjfDg@mail.gmail.com>
	<CAA4eK1+V25w5JO=i++W=Mzyf3i8d3++Y2JvuStqSLMk6QMUyeg@mail.gmail.com>
	<CALDaNm0Abj_Ui3apZWuuMLtvqic6eoQCn3EgZzcxNAfz5grDUw@mail.gmail.com>
	<OS0PR01MB571613363874441516C5BBCC94469@OS0PR01MB5716.jpnprd01.prod.outlook.com>

On 14.09.22 07:10, houzj.fnst@fujitsu.com wrote:
> After applying the patch, we support adding a table with column list along with
> the table's schema[1], and it will directly apply the column list in the
> logical replication after applying the patch.
> 
> [1]--
> CREATE PUBLICATION pub FOR TABLE public.test(a), FOR ALL TABLES IN SCHEMA public;
> -----
> 
> If from the point of view of consistency, for column list, we could report an
> ERROR because we currently don't allow using different column lists for a
> table. Maybe an ERROR like:
> 
> "ERROR: cannot use column for table x when the table's schema is also in the publication"
> 
> But if we want to report an ERROR for column list in above case. We might need
> to restrict the ALTER TABLE SET SCHEMA as well because user could move a table
> which is published with column list to a schema that is also published in the
> publication, so we might need to add some similar check(which is removed in
> Vignesh's patch) to tablecmd.c to disallow this case.
> 
> Another option could be just ingore the column list if table's schema is also
> part of publication. But it seems slightly inconsistent with the rule that we
> disallow using different column list for a table.

Ignoring things doesn't seem like a good idea.

A solution might be to disallow adding any schemas to a publication if 
column lists on a table are specified.





view thread (46+ messages)  latest in thread

Message-ID: <b2ffd236-fefd-f8f8-05a0-dc603e5a2bae@enterprisedb.com>
Permalink:  ../b2ffd236-fefd-f8f8-05a0-dc603e5a2bae@enterprisedb.com/
Also on:    postgresql.org/message-id/b2ffd236-fefd-f8f8-05a0-dc603e5a2bae@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@enterprisedb.com, houzj.fnst@fujitsu.com, vignesh21@gmail.com, amit.kapila16@gmail.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: why can't a table be part of the same publication as its schema
  In-Reply-To: <b2ffd236-fefd-f8f8-05a0-dc603e5a2bae@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox