Re: Upper limit arguments of pg_logical_slot_xxx_changes functions accept invalid values

From: Brian Faherty <anothergenericuser(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: Upper limit arguments of pg_logical_slot_xxx_changes functions accept invalid values
Date: 2018-07-26 22:05:45
Message-ID: 153264274574.1561.8635513309255858878.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: not tested
Documentation: not tested

The error messages are nice, and I think will be a helpful feature. This patch does add them correctly and also tests them.

A few things I noticed, in the code, that don't really interfere with functionality are below:
In the `if (PG_ARGISNULL(1))` section:
I was wondering if creating an alias called something like InfinateInvalidXLogRecPtr might be better than adding a comment saying infinite.

In the `if (PG_ARGISNULL(2))` section:
I think '0' is being used as a magic number here and could probably have another #define (linked to a place to put it below). Also, it seems a little weird to take NULL and then just set upto_nchanges to '0' while disallowing '0' to be passed in as the argument. Maybe just allowing '0' as an input would be ok and useful to some people. I don't believe I would have noticed that if 'upto_nchanges = UnlimitedNchanges` instead of 'upto_nchanges = 0'.

https://doxygen.postgresql.org/xlogdefs_8h_source.html#l00028

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2018-07-26 22:22:16 Re: pgbench: improve --help and --version parsing
Previous Message Tom Lane 2018-07-26 21:45:17 Re: [HACKERS] Getting rid of "accept incoming network connections" prompts on OS X