Thread: Correction for replication slot creation error message in 9.6

Correction for replication slot creation error message in 9.6

From
Ian Barwick
Date:
Hi

Currently pg_create_physical_replication_slot() may refer to
the deprecated wal_level setting "archive":

  postgres=# SHOW wal_level ;
   wal_level
  -----------
   minimal
  (1 row)

  postgres=# SELECT pg_create_physical_replication_slot('some_slot');
  ERROR:  replication slots can only be used if wal_level is  >= archive

Patch changes the error message to:

  ERROR:  replication slots can only be used if wal_level is "replica" or "logical"

Explicitly naming the valid WAL levels matches the wording in the wal_level
error hint used in a couple of places, i.e.

  "wal_level must be set to "replica" or "logical" at server start."


Regards

Ian Barwick

--
 Ian Barwick                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

Re: Correction for replication slot creation error message in 9.6

From
Michael Paquier
Date:
On Thu, Mar 31, 2016 at 10:15 AM, Ian Barwick <ian@2ndquadrant.com> wrote:
> Currently pg_create_physical_replication_slot() may refer to
> the deprecated wal_level setting "archive":

(Adding Peter in CC who committed this patch).

> Patch changes the error message to:
>
>   ERROR:  replication slots can only be used if wal_level is "replica" or "logical"

Sounds right to me.

> Explicitly naming the valid WAL levels matches the wording in the wal_level
> error hint used in a couple of places, i.e.
>
>   "wal_level must be set to "replica" or "logical" at server start."

It is worth telling that Peter and I both had this code in front of
our eyes during the review :) Still we missed that.
-- 
Michael



Re: Correction for replication slot creation error message in 9.6

From
Andres Freund
Date:
On 2016-03-31 10:15:21 +0900, Ian Barwick wrote:
> Hi
> 
> Currently pg_create_physical_replication_slot() may refer to
> the deprecated wal_level setting "archive":
> 
>   postgres=# SHOW wal_level ;
>    wal_level
>   -----------
>    minimal
>   (1 row)
> 
>   postgres=# SELECT pg_create_physical_replication_slot('some_slot');
>   ERROR:  replication slots can only be used if wal_level is  >= archive
> 
> Patch changes the error message to:
> 
>   ERROR:  replication slots can only be used if wal_level is "replica" or "logical"
> 
> Explicitly naming the valid WAL levels matches the wording in the wal_level
> error hint used in a couple of places, i.e.

The explicit naming makes it much more verbose to change anything around
wal level though, so consider me not a fan of spelling out all levels.

Greetings,

Andres Freund



Re: Correction for replication slot creation error message in 9.6

From
Alvaro Herrera
Date:
Andres Freund wrote:
> On 2016-03-31 10:15:21 +0900, Ian Barwick wrote:

> > Patch changes the error message to:
> > 
> >   ERROR:  replication slots can only be used if wal_level is "replica" or "logical"
> > 
> > Explicitly naming the valid WAL levels matches the wording in the wal_level
> > error hint used in a couple of places, i.e.
> 
> The explicit naming makes it much more verbose to change anything around
> wal level though, so consider me not a fan of spelling out all levels.

I thought we had agreed that we weren't going to consider the wal_level
values as a linear scale -- in other words, wordings such as "greater
than FOO" are discouraged.  That's always seemed a bit odd to me.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: Correction for replication slot creation error message in 9.6

From
Michael Paquier
Date:
On Thu, Mar 31, 2016 at 11:18 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Andres Freund wrote:
>> On 2016-03-31 10:15:21 +0900, Ian Barwick wrote:
>
>> > Patch changes the error message to:
>> >
>> >   ERROR:  replication slots can only be used if wal_level is "replica" or "logical"
>> >
>> > Explicitly naming the valid WAL levels matches the wording in the wal_level
>> > error hint used in a couple of places, i.e.
>>
>> The explicit naming makes it much more verbose to change anything around
>> wal level though, so consider me not a fan of spelling out all levels.
>
> I thought we had agreed that we weren't going to consider the wal_level
> values as a linear scale -- in other words, wordings such as "greater
> than FOO" are discouraged.  That's always seemed a bit odd to me.

Yes, that's what I thought as well.
-- 
Michael



Re: Correction for replication slot creation error message in 9.6

From
Ian Barwick
Date:
On 16/04/01 8:15, Michael Paquier wrote:
> On Thu, Mar 31, 2016 at 11:18 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
>> Andres Freund wrote:
>>> On 2016-03-31 10:15:21 +0900, Ian Barwick wrote:
>>
>>>> Patch changes the error message to:
>>>>
>>>>   ERROR:  replication slots can only be used if wal_level is "replica" or "logical"
>>>>
>>>> Explicitly naming the valid WAL levels matches the wording in the wal_level
>>>> error hint used in a couple of places, i.e.
>>>
>>> The explicit naming makes it much more verbose to change anything around
>>> wal level though, so consider me not a fan of spelling out all levels.
>>
>> I thought we had agreed that we weren't going to consider the wal_level
>> values as a linear scale -- in other words, wordings such as "greater
>> than FOO" are discouraged.  That's always seemed a bit odd to me.
> 
> Yes, that's what I thought as well.

I don't remember if I saw that particular discussion, but same here.
I suppose the alternative would be something like this:
 ERROR: replication slots cannot be used if wal_level is "minimal"

(providing it remains the only "sub-replica" WAL level ;) ).


Regards

Ian Barwick

-- Ian Barwick                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, RemoteDBA, Training &
Services



Re: Correction for replication slot creation error message in 9.6

From
Peter Eisentraut
Date:
On 03/30/2016 09:15 PM, Ian Barwick wrote:
> Currently pg_create_physical_replication_slot() may refer to
> the deprecated wal_level setting "archive":

I have fixed this in the most direct way, since there was some 
disagreement about rewording.




Re: Correction for replication slot creation error message in 9.6

From
Peter Eisentraut
Date:
On 03/31/2016 10:18 AM, Alvaro Herrera wrote:
> I thought we had agreed that we weren't going to consider the wal_level
> values as a linear scale -- in other words, wordings such as "greater
> than FOO" are discouraged.  That's always seemed a bit odd to me.

I don't think there was any agreement about that.




Re: Correction for replication slot creation error message in 9.6

From
Ian Barwick
Date:
On 05/04/16 10:24, Peter Eisentraut wrote:
> On 03/30/2016 09:15 PM, Ian Barwick wrote:
>> Currently pg_create_physical_replication_slot() may refer to
>> the deprecated wal_level setting "archive":
> 
> I have fixed this in the most direct way, since there was some disagreement about rewording.

Thanks!


Regards

Ian Barwick


-- Ian Barwick                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services