[HACKERS] ALTER SUBSCRIPTION ..SET PUBLICATION refresh is notthrowing error. - Mailing list pgsql-hackers

From tushar
Subject [HACKERS] ALTER SUBSCRIPTION ..SET PUBLICATION refresh is notthrowing error.
Date
Msg-id 7ac3d374-2217-973d-1af7-ee11fd65eadc@enterprisedb.com
Whole thread Raw
Responses Re: [HACKERS] ALTER SUBSCRIPTION ..SET PUBLICATION refreshis not throwing error.  (Euler Taveira <euler@timbira.com.br>)
List pgsql-hackers
Hi,

ALTER SUBSCRIPTION ..SET PUBLICATION <no name> refresh  is removing all 
the attached subscription('s).

X Machine -

s=# create table t(n int);
CREATE TABLE
s=# create table t1(n int);
CREATE TABLE
s=# create publication pub for table  t,t1;
CREATE PUBLICATION
s=#

Y Machine -

s=# create table t(n int);
CREATE TABLE
s=# create table t1(n int);
CREATE TABLE
s=# create subscription s1 connection 'dbname=s port=5432 user=centos 
host=localhost' publication pub;
NOTICE:  synchronized table states
NOTICE:  created replication slot "s1" on publisher
CREATE SUBSCRIPTION

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=#

I think - this is probably due to not given publication NAME in the sql 
query .

we are doing a syntax check at the time of REFRESH but not with SKIP 
REFRESH

s=# alter subscription s1 set publication   refresh ;
ERROR:  syntax error at or near ";"
LINE 1: alter subscription s1 set publication   refresh ;                                                        ^
s=# alter subscription s1 set publication  skip refresh ;
ALTER SUBSCRIPTION
s=#

-- 
regards,tushar
EnterpriseDB  https://www.enterprisedb.com/
The Enterprise PostgreSQL Company




pgsql-hackers by date:

Previous
From: Dmitry Dolgov
Date:
Subject: Re: [HACKERS] Create subscription with `create_slot=false` andincorrect slot name
Next
From: Andrew Borodin
Date:
Subject: [HACKERS] Index Only Scan support for cube