Search Postgresql Archives

New operators and class for jsonb with gin indexing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all!

I am having problems applying gin indexing to my new operator class for type jsonb.
I created an operator that can query(jsonb column) keys and dates where dates are more than, less than, equal and not equal to the one provided inside another jsonb.
Because I want to make it use index search and not sequential search, I wanted to use gin indexing, but it says that i'm missing support functions. Did anybody try to do something like this? I searched everywhere online, and I didn't see an example of how they should look like. This is how i created an operator class

CREATE OPERATOR CLASS custom_jsonb_dates_operators FOR TYPE jsonb
USING gin  AS
OPERATOR 1 #>? (jsonb, jsonb),
OPERATOR 2 #<? (jsonb, jsonb),
OPERATOR 3 #=? (jsonb, jsonb),
OPERATOR 4 #!=? (jsonb, jsonb)
After this, when i created an index with this operator class, i got the following error:
missing support function 2 for attribute 1 of index "idx_name"
I tried writing my own support functions, but none worked(after creating an index, it just never returned any results.

Thanks,
Luka Zivkovic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux