pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: why can't a table be part of the same publication as its schema
Date: Fri, 09 Sep 2022 02:14:51 -0400
Message-ID: <37271.1662704091@sss.pgh.pa.us> (raw)
In-Reply-To: <CAA4eK1KDX2S1bct1-y_dXpV3VpYU5CotU9MN57uzPOSWEararQ@mail.gmail.com>
References: <2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e@enterprisedb.com>
	<CAA4eK1KDX2S1bct1-y_dXpV3VpYU5CotU9MN57uzPOSWEararQ@mail.gmail.com>

Amit Kapila <amit.kapila16@gmail.com> writes:
> To avoid these confusions, we have disallowed adding a table if its
> schema is already part of the publication and vice-versa.

Really?

Is there logic in ALTER TABLE SET SCHEMA that rejects the command
dependent on the contents of the publication tables?  If so, are
there locks taken in both ALTER TABLE SET SCHEMA and the
publication-modifying commands that are sufficient to prevent
race conditions in such changes?

This position sounds quite untenable from here, even if I found
your arguments-in-support convincing, which I don't really.
ISTM the rule should be along the lines of "table S.T should
be published either if schema S is published or S.T itself is".
There's no obvious need to interconnect the two conditions.

			regards, tom lane





view thread (46+ messages)  latest in thread

Message-ID: <37271.1662704091@sss.pgh.pa.us>
Permalink:  ../37271.1662704091@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/37271.1662704091@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, amit.kapila16@gmail.com, peter.eisentraut@enterprisedb.com
  Subject: Re: why can't a table be part of the same publication as its schema
  In-Reply-To: <37271.1662704091@sss.pgh.pa.us>

* 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