Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-06-03 Thread Dmitry Dolgov
> On 26 May 2017 at 23:05, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > > > On 5/25/17 19:16, Petr Jelinek wrote: > >> The reported error is just one of many errors that can happen when DROP > >> SUBSCRIPTION tries to drop the slot (doens't exist, still active, no > >> permission,

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-06-02 Thread Peter Eisentraut
On 6/1/17 08:20, Petr Jelinek wrote: > I think the combination of those patches is probably good enough > solution for PG10 (I never understood the need for name validation in > ReplicationSlotAcquire() anyway). I have committed these two patches and will close this open item. -- Peter Eisentrau

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-06-01 Thread Petr Jelinek
On 01/06/17 04:44, Peter Eisentraut wrote: > On 5/31/17 09:40, Robert Haas wrote: >> On Tue, May 30, 2017 at 3:01 PM, Peter Eisentraut >> wrote: >>> On 5/25/17 17:26, Peter Eisentraut wrote: Another way to fix this particular issue is to not verify the replication slot name before doing

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-31 Thread Peter Eisentraut
On 5/31/17 09:40, Robert Haas wrote: > On Tue, May 30, 2017 at 3:01 PM, Peter Eisentraut > wrote: >> On 5/25/17 17:26, Peter Eisentraut wrote: >>> Another way to fix this particular issue is to not verify the >>> replication slot name before doing the drop. After all, if the name is >>> not valid

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-31 Thread Robert Haas
On Tue, May 30, 2017 at 3:01 PM, Peter Eisentraut wrote: > On 5/25/17 17:26, Peter Eisentraut wrote: >> Another way to fix this particular issue is to not verify the >> replication slot name before doing the drop. After all, if the name is >> not valid, then you can also just report that it doesn

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-30 Thread Peter Eisentraut
On 5/25/17 17:26, Peter Eisentraut wrote: > Another way to fix this particular issue is to not verify the > replication slot name before doing the drop. After all, if the name is > not valid, then you can also just report that it doesn't exist. Here is a possible patch along these lines. -- Pet

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-26 Thread Peter Eisentraut
On 5/25/17 19:16, Petr Jelinek wrote: >> The reported error is just one of many errors that can happen when DROP >> SUBSCRIPTION tries to drop the slot (doens't exist, still active, no >> permission, etc.). We don't want to give the hint that is effectively >> "just forget about the slot then" for

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-25 Thread Petr Jelinek
On 25/05/17 23:26, Peter Eisentraut wrote: > On 5/24/17 21:41, Robert Haas wrote: >>> This came up in a previous thread. It is up to the publishing end what >>> slot names it accepts. So running the validation locally is incorrect. >> >> That argument seems pretty tenuous; surely both ends are Po

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-25 Thread Peter Eisentraut
On 5/24/17 21:41, Robert Haas wrote: >> This came up in a previous thread. It is up to the publishing end what >> slot names it accepts. So running the validation locally is incorrect. > > That argument seems pretty tenuous; surely both ends are PostgreSQL, > and the rules for valid slot names a

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-24 Thread Masahiko Sawada
On Wed, May 24, 2017 at 9:41 PM, Robert Haas wrote: > On Wed, May 24, 2017 at 7:31 PM, Peter Eisentraut > wrote: >> On 5/23/17 02:33, Kuntal Ghosh wrote: The command succeed even if slot_name is invalid. That's because slot_name isn't validated. ReplicationSlotValidateName() should be c

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-24 Thread Robert Haas
On Wed, May 24, 2017 at 7:31 PM, Peter Eisentraut wrote: > On 5/23/17 02:33, Kuntal Ghosh wrote: >>> 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 e

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-24 Thread Peter Eisentraut
On 5/23/17 02:33, Kuntal Ghosh wrote: >> 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

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-23 Thread Dmitry Dolgov
On 23 May 2017 at 07:26, Euler Taveira wrote: > > 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). Yes, I see now. I assume this little patch should be enough for that. diff -

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-22 Thread Kuntal Ghosh
On Tue, May 23, 2017 at 10:56 AM, Euler Taveira wrote: > 2017-05-22 17:52 GMT-03:00 Dmitry Dolgov <9erthali...@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 possi

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-22 Thread Euler Taveira
2017-05-22 17:52 GMT-03:00 Dmitry Dolgov <9erthali...@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 > particu

[HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-05-22 Thread Dmitry Dolgov
Hi 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: =