Re: btree_gin and btree_gist for enums

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: btree_gin and btree_gist for enums
Date: 2017-02-26 20:09:13
Message-ID: 8a9a7d1a-54e4-4d76-ddd6-f5a8f1829de3@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/25/2017 01:39 PM, Andrew Dunstan wrote:
>
> On 02/25/2017 01:34 PM, Tom Lane wrote:
>> Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> writes:
>>> On 02/25/2017 12:04 PM, Tom Lane wrote:
>>>> I think it'd be better to leave DirectFunctionCallN alone and just invent
>>>> a small number of CallerFInfoFunctionCallN support functions (maybe N=1
>>>> and N=2 would be enough, at least for now).
>>> See attached.
>> Yeah, I like this better, except that instead of
>>
>> + * The callee should not look at anything except the fn_mcxt and fn_extra.
>> + * Anything else is likely to be bogus.
>>
>> maybe
>>
>> + * It's recommended that the callee only use the fn_extra and fn_mcxt
>> + * fields, as other fields will typically describe the calling function
>> + * not the callee. Conversely, the calling function should not have
>> + * used fn_extra, unless its use is known compatible with the callee's.
>>
>>
>
> OK, Works for me. Thanks.
>

This works for the btree_gin case. However, there's a difficulty for
btree_gist - in the puicksplit routine the cmp function is passed to
qsort() so there is no chance to pass it an flinfo to set up the call to
the real comparison routine. Implementing a custom sort routine to work
around the problem seems a bridge too far. I can;t think of an
alternative off hand.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-02-26 20:21:56 Re: IF (NOT) EXISTS in psql-completion
Previous Message Corey Huinker 2017-02-26 20:07:06 Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)