[HACKERS] Shouldn't duplicate addition to publication be a no-op?

Поиск
Список
Период
Сортировка
От Amit Langote
Тема [HACKERS] Shouldn't duplicate addition to publication be a no-op?
Дата
Msg-id 64ec4f57-9361-d32c-ecbe-86158437cb7e@lab.ntt.co.jp
обсуждение исходный текст
Ответы Re: [HACKERS] Shouldn't duplicate addition to publication be a no-op?
Re: [HACKERS] Shouldn't duplicate addition to publication be a no-op?
Список pgsql-hackers
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).

create table bar (a int);
create publication mypub for table bar;
alter publication mypub add table bar;
ERROR:  relation "bar" is already member of publication "mypub"

2nd command should be a no-op, IMHO.

Consider the following (I know we're discussing inheritance elsewhere as
well):

create table foo (a int);
create table baz () inherits (foo);
alter table bar inherit foo;

alter table mypub add table foo;
ERROR:  relation "bar" is already member of publication "mypub"

There is no way to add foo and children other than bar to mypub without
doing so one-by-one.

If my proposal to make that a no-op sounds desirable, attached patch
implements that.

Thanks,
Amit

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Interval for launching the table sync worker
Следующее
От: Vitaly Burovoy
Дата:
Сообщение: Re: [HACKERS] sequence data type