Re: [HACKERS] Create subscription with `create_slot=false` andincorrect slot name - Mailing list pgsql-hackers

From Kuntal Ghosh
Subject Re: [HACKERS] Create subscription with `create_slot=false` andincorrect slot name
Date
Msg-id CAGz5QCKVwMktJ5kTh7_iWx6XciDQCshhmdACJNvrpGwRsh2c7Q@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Create subscription with `create_slot=false` andincorrect slot name  (Euler Taveira <euler@timbira.com.br>)
Responses Re: [HACKERS] Create subscription with `create_slot=false` andincorrect slot name  (Dmitry Dolgov <9erthalion6@gmail.com>)
Re: [HACKERS] Create subscription with `create_slot=false` andincorrect slot name  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On Tue, May 23, 2017 at 10:56 AM, Euler Taveira <euler@timbira.com.br> wrote:
> 2017-05-22 17:52 GMT-03:00 Dmitry Dolgov <9erthalion6@gmail.com>:
>>
>> Maybe this question was already raised before, but I couldn't find a
>> discussion. When I'm creating a subscription with `create_slot=false`
>> looks
>> like it's possible to pass a slot name with invalid characters. In this
>> particular case both publisher and subscriber were on the same machine:
>>
>>     =# CREATE SUBSCRIPTION test_sub CONNECTION 'dbname=db host=host
>> port=port user=user' PUBLICATION test_pub WITH (create_slot=false,
>> slot_name='test slot');
>>     NOTICE:  00000: synchronized table states
>>     LOCATION:  CreateSubscription, subscriptioncmds.c:443
>>     CREATE SUBSCRIPTION
>>     Time: 5.887 ms
>>
> The command succeed even if slot_name is invalid. That's because slot_name
> isn't validated. ReplicationSlotValidateName() should be called in
> parse_subscription_options() to avoid a pilot error. IMHO we should prevent
> a future error (use of invalid slot name).
>
+1. Since, slot_name can be provided even when create_slot is set
false, it should be validated as well while creating the subscription.



-- 
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: tushar
Date:
Subject: Re: [HACKERS] Getting server crash after running sqlsmith
Next
From: vinayak
Date:
Subject: [HACKERS] ECPG: pg_type.h file is not synced