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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Amul Sul <sulamul(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options
Date: 2021-06-11 20:29:10
Message-ID: CA+TgmoaEUfU4mXAo47Q41t7EztXPWoPExWMK6y7nGjG2kuGvoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 25, 2021 at 9:38 AM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> This should be okay, right? Well, almost. The problem here is if you
> want to have a variable where you set more than one option, you have to
> use bit-and of the enum values ... and the resulting value is no longer
> part of the enum. A compiler would be understandably upset if you try
> to pass that value in a variable of the enum datatype.

Yes. I dislike this style for precisely this reason.

I may, however, be in the minority.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-06-11 20:29:54 Re: Character expansion with ICU collations
Previous Message Robert Haas 2021-06-11 20:25:59 Re: [bug?] Missed parallel safety checks, and wrong parallel safety