Re: btree_gin and btree_gist for enums
Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2017-02-24T00:20:32Z
Lists: pgsql-hackers
Attachments
- enum-btree-gin-2.patch (text/x-diff) patch
On 02/23/2017 04:41 PM, Tom Lane wrote: > Andrew Dunstan <andrew.dunstan@2ndquadrant.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. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Add btree_gin support for enum types
- 4ad0f88c443c 10.0 landed
-
Add btree_gist support for enum types.
- f7946a92b689 10.0 landed
-
Use CallerFInfoFunctionCall with btree_gist for numeric types
- 4b1c68d63e86 10.0 landed
-
Add a direct function call mechanism using the caller's context.
- 29bf5016835a 10.0 landed
-
Add support for EUI-64 MAC addresses as macaddr8
- c7a9fa399d55 10.0 cited
-
Add an Assert that enum_cmp_internal() gets passed an FmgrInfo pointer.
- 6d493e1a0135 10.0 landed