Re: operators, operator classes, Btree and index usage - Mailing list pgsql-general

From Tom Lane
Subject Re: operators, operator classes, Btree and index usage
Date
Msg-id 17673.1125692503@sss.pgh.pa.us
Whole thread Raw
In response to operators, operator classes, Btree and index usage  ("Sergey E. Koposov" <math@sai.msu.ru>)
Responses Re: operators, operator classes, Btree and index usage
List pgsql-general
"Sergey E. Koposov" <math@sai.msu.ru> writes:
> I'm interested in simplifying those queries and introducing the operator
> doing something like this:

> my_operator(bigint x, bigint[] arr)
> checking  the condition:
> ((x>arr[1]) AND (x<arr[2])) OR ((x>arr[3]) AND (x<arr[4]))

This could be made to work if you define the above as an inline-able SQL
function.  Hacking operator classes won't do it though.

            regards, tom lane

pgsql-general by date:

Previous
From: "Sergey E. Koposov"
Date:
Subject: operators, operator classes, Btree and index usage
Next
From: Poul Møller Hansen
Date:
Subject: Re: Check if SELECT is granted