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

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.
Date: 2014-03-21 21:47:48
Message-ID: 20140321214748.GC17111@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 2014-03-21 17:37:35 -0400, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)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?

It seems to be a memory only type, so using anything but the raw enum
type seems odd. If it were ondisk alignment stuff could make it
advantageous, but this way...

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-03-21 21:58:17 Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.
Previous Message Tom Lane 2014-03-21 21:37:35 Re: pgsql: Allow opclasses to provide tri-valued GIN consistent functions.