Re: [HACKERS] Shouldn't duplicate addition to publication be a no-op? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Shouldn't duplicate addition to publication be a no-op?
Date
Msg-id 11698.1492086832@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Shouldn't duplicate addition to publication be a no-op?  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] Shouldn't duplicate addition to publication be a no-op?  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-hackers
Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
> I wonder if trying to add a relation to a publication that it is already a
> part should be considered a no-op, instead of causing an error (which
> happens in the ALTER PUBLICATION ADD TABLES case).

On what grounds?

The equivalent case for inheritance is an error:

regression=# create table foo (a int);
CREATE TABLE
regression=# create table bar () inherits (foo);
CREATE TABLE
regression=# alter table bar inherit foo;
ERROR:  relation "foo" would be inherited from more than once

(Your example purporting to show the contrary contains a typo.)

If there's a reason why this case should act differently from that
precedent, you haven't shown it.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Yorick Peterse
Date:
Subject: Re: [HACKERS] [PATCH] Document the order of changing certain settingswhen using hot-standby servers
Next
From: Heikki Linnakangas
Date:
Subject: Re: [HACKERS] pg_statistic_ext.staenabled might not be the bestcolumn name