Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Michael Paquier <michael@paquier.xyz>, Amul Sul <sulamul@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-07-02T02:06:22Z
Lists: pgsql-hackers
On Thu, Jul 1, 2021 at 8:00 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> I find the business with OPT_NONE a bit uselessly verbose.  It's like we
> haven't completely made up our minds that zero means no options set.
> Wouldn't it be simpler to remove that #define and leave the variable
> uninitialized until we want to set the options we want, and then use
> plain assignment instead of |= ?
>

Yeah, that makes sense. I have removed its usage from
CreateSubscription but I think we can get rid of it entirely as well.

The latest patch sent by Bharath looks good to me. Would you like to
commit it or shall I take care of it?

-- 
With Regards,
Amit Kapila.



Commits

  1. Refactor function parse_subscription_options.

  2. Refactor function parse_output_parameters.

  3. Refactor option handling of CLUSTER, REINDEX and VACUUM

  4. Add assertion to quiet Coverity