Re: [HACKERS] GSoC 2017: Foreign Key Arrays - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: [HACKERS] GSoC 2017: Foreign Key Arrays
Date
Msg-id 4157a5f1-d2ab-02bf-f497-5753190aa75e@proxel.se
Whole thread Raw
In response to Re: [HACKERS] GSoC 2017: Foreign Key Arrays  (Mark Rofail <markm.rofail@gmail.com>)
Responses Re: [HACKERS] GSoC 2017: Foreign Key Arrays
List pgsql-hackers
On 01/21/2018 10:36 PM, Mark Rofail wrote:
>     == The @>> operator
> 
>     A previous version of your patch added the "anyelement <<@ anyarray"
>     operator to avoid having to build arrays, but that part was reverted
>     due to a bug.
> 
>     I am not expert on the gin code, but as far as I can tell it would
>     be relatively simple to fix that bug. Just allocate an array of
>     Datums of length one where you put the element you are searching for
>     (or maybe a copy of it).
> 
> The @>> is now restored and functioning correctly, all issues with 
> contrib libraries has been resolved

Hi,

I looked some at your anyarray @>> anyelement code and sadly it does not 
look like the index code could work. The issue I see is that 
ginqueryarrayextract() needs to make a copy of the search key but to do 
so it needs to know the type of anyelement (to know if it needs to 
detoast, etc). But there is as far as I can tell no way to check the 
type of anyelement in this context.

Am I missing something?

Andreas


pgsql-hackers by date:

Previous
From: Jason Petersen
Date:
Subject: Re: JIT compiling with LLVM v9.0
Next
From: Ivan Novick
Date:
Subject: Re: Regarding drop index