Re: operators, operator classes, Btree and index usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sergey E(dot) Koposov" <math(at)sai(dot)msu(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: operators, operator classes, Btree and index usage
Date: 2005-09-02 20:21:43
Message-ID: 17673.1125692503@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Sergey E. Koposov" <math(at)sai(dot)msu(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Poul Møller Hansen 2005-09-02 20:39:14 Re: Check if SELECT is granted
Previous Message Josh Berkus 2005-09-02 19:29:41 Re: PL/pgSQL: EXCEPTION NOSAVEPOINT