Re: [HACKERS] pg_hba_file_settings view patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] pg_hba_file_settings view patch
Date
Msg-id 21357.1485817467@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] pg_hba_file_settings view patch  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Responses Re: [HACKERS] pg_hba_file_settings view patch
List pgsql-hackers
Haribabu Kommi <kommi.haribabu@gmail.com> writes:
> On Mon, Jan 30, 2017 at 5:18 PM, Michael Paquier <michael.paquier@gmail.com>
> wrote:
>> #define USER_AUTH_LAST uaPeer
>> StaticAssertStmt(lengthof(UserAuthName) == USER_AUTH_LAST + 1,
>> "UserAuthName must include all user authentication names");

> Thanks for the review. Added the static assert statement.

This isn't exactly bulletproof, since somebody could add another enum
value and forget to update the macro.  Still, it's better than nothing.
I tried to make it a shade more idiot-proof by putting the #define
physically inside the enum list --- you'd have to really have blinders
on to not notice it there.  (Not that people haven't made equally silly
mistakes :-(.)

Pushed with that adjustment.  Thanks for working on this!
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Query fails when SRFs are part of FROM clause (Commit id: 69f4b9c85f)
Next
From: Nikita Glukhov
Date:
Subject: [HACKERS] [PATCH] kNN for SP-GiST