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-24 00:20:32
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On 02/23/2017 04:41 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> writes:
>> I'm not entirely sure how I should replace those DirectFunctionCall2 calls.
> Basically what we want is for the called function to be able to use the
> fcinfo->flinfo->fn_extra and fcinfo->flinfo->fn_mcxt fields of the
> FmgrInfo struct that GIN has set up for the btree_gin support function.
> The fast but somewhat scary way to do it would just be to pass through
> the flinfo pointer as-is. Imagine that fmgr.c grows a set of functions
> like
> [...]

Here's a POC for btree_gin based on my original patch. I just made your
function static in btree_gin.c at least for now. I stayed with the
DirectFunctionCall2 use in the type-specific routines where calling
context wasn't needed (i.e. everything except enums). But it looks more
than ugly and highly invasive for btree_gist, and sadly that's my main
use case, exclusion constraints with enum fields.



Andrew Dunstan
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
enum-btree-gin-2.patch text/x-diff 8.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-02-24 00:29:54 Re: Automatic cleanup of oldest WAL segments with pg_receivexlog
Previous Message Andrew Dunstan 2017-02-24 00:09:57 Re: bytea_output output of base64