Re: ALTER SUBSCRIPTION ..SET PUBLICATION <no name> refresh is not throwing error.

From: Euler Taveira <euler(at)timbira(dot)com(dot)br>
To: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
Subject: Re: ALTER SUBSCRIPTION ..SET PUBLICATION <no name> refresh is not throwing error.
Date: 2017-05-24 19:07:34
Message-ID: CAHE3wghqkBw-3w_qSDzEMX+CLP0VFON13NsqeWeMYvh3bDvcRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2017-05-23 6:00 GMT-03:00 tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>:

>
> s=# alter subscription s1 set publication skip refresh ;
> NOTICE: removed subscription for table public.t
> NOTICE: removed subscription for table public.t1
> ALTER SUBSCRIPTION
> s=#

That's a design flaw. Since SKIP is not a reserved word, parser consider it
as a publication name. Instead of causing an error, it executes another
command (REFRESH) that is the opposite someone expects. Also, as "skip" is
not a publication name, it removes all tables in the subscription.

ALTER SUBSCRIPTION name SET PUBLICATION publication_name_list SKIP REFRESH
ALTER SUBSCRIPTION name SET PUBLICATION publication_name_list REFRESH
opt_definition

I think the first command was a bad design. Why don't we transform SKIP
REFRESH into a REFRESH option?

ALTER SUBSCRIPTION sub1 SET PUBLICATION pub1 REFRESH WITH (skip = true);

skip (boolean): specifies that the command will not try to refresh table
information. The default is false.

--
Euler Taveira Timbira -
http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
<http://www.timbira.com.br>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2017-05-24 19:14:31 Re: Get stuck when dropping a subscription during synchronizing table
Previous Message Paul Ramsey 2017-05-24 18:14:56 Re: generate_series regression 9.6->10