Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions. - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.
Date
Msg-id 26291.1395437855@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.  (Andres Freund <andres@2ndquadrant.com>)
Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
Andres Freund <andres@2ndquadrant.com> writes:
> I think the GinLogicValueEnum is supposed to be an enum's name, not a
> variable name, right?

I think the whole thing is too cute by half.  Why isn't it just

typedef enum GinLogicValue
{
    GIN_FALSE = 0,           /* item is present / matches */
    GIN_TRUE = 1,            /* item is not present / does not match */
    GIN_MAYBE = 2            /* don't know if item is present / don't know if
                              * matches */
} GinLogicValue;

instead of thinking that we are smarter than the compiler about how
to store the enum?  For that matter, those explicit specifications of
the enum tag numeric values seem unnecessary and bad style IMV.

            regards, tom lane


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.
Next
From: Andres Freund
Date:
Subject: Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.