Re: [HACKERS] wal_level > WAL_LEVEL_LOGICAL

2017-05-25 Thread Neha Khatri
On Wed, 24 May 2017 at 10:29 pm, Robert Haas  wrote:

> On Mon, May 22, 2017 at 9:08 AM, Neha Khatri 
> wrote:
> > As per my understabding, current postgres server supports only three
> > values for wal_level i.e. 'minimal' , 'replica' or 'logical'. But
> > following error message brought to notice that there are various code
> > spots that try to look for wal_level >= WAL_LEVEL_LOGICAL:
>
> I suspect that this was intended as future-proofing.  I think it's
> actually very reasonable to write the internal tests that way,


Agreed. Share the same thought and also started another thread just for the
user visible error message improvement [1]. In that thread the error
message is perceived to be correct.

but it
> does seem strange that it's crept into the user-visible error
> messages.


Yep, this seems useful for developer but not the end user.

[1]
https://www.postgresql.org/message-id/CAFO0U%2B_y8AyAcQLiF3S1i6yCNuYrcLNEd-BbzCuHiGOSejW%3D2A%40mail.gmail.com

Regards,
Neha
-- 
Cheers,
Neha


Re: [HACKERS] wal_level > WAL_LEVEL_LOGICAL

2017-05-24 Thread Robert Haas
On Mon, May 22, 2017 at 9:08 AM, Neha Khatri  wrote:
> As per my understabding, current postgres server supports only three
> values for wal_level i.e. 'minimal' , 'replica' or 'logical'. But
> following error message brought to notice that there are various code
> spots that try to look for wal_level >= WAL_LEVEL_LOGICAL:

I suspect that this was intended as future-proofing.  I think it's
actually very reasonable to write the internal tests that way, but it
does seem strange that it's crept into the user-visible error
messages.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] wal_level > WAL_LEVEL_LOGICAL

2017-05-22 Thread Neha Khatri
As per my understabding, current postgres server supports only three
values for wal_level i.e. 'minimal' , 'replica' or 'logical'. But
following error message brought to notice that there are various code
spots that try to look for wal_level >= WAL_LEVEL_LOGICAL:

  select * from pg_create_logical_replication_slot('regression_slot',
'test_decoding');
  ERROR:  logical decoding requires wal_level >= logical

The code locations that look for/expect wal_level > WAL_LEVEL_LOGICAL are:

 heapam.c 7690 * This is only used in wal_level >=
WAL_LEVEL_LOGICAL, and only for catalog
 logical.c   83 errmsg("logical decoding requires wal_level >=
logical")));
 standby.cLogStandbySnapshot   950 if (wal_level
>= WAL_LEVEL_LOGICAL)
 xlog.h   XLogLogicalInfoActive162 #define
XLogLogicalInfoActive() (wal_level >= WAL_LEVEL_LOGICAL)

Since postgres does not allow wal_level > WAL_LEVEL_LOGICAL, the above
code locations should be modified like:

 s/>=/=

Thoughts/Suggestions?

Regards,
Neha


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers