Re: Partial match in GIN - Mailing list pgsql-patches

From Gregory Stark
Subject Re: Partial match in GIN
Date
Msg-id 87tzic4gwv.fsf@oxford.xeocode.com
Whole thread Raw
In response to Partial match in GIN  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-patches
"Teodor Sigaev" <teodor@sigaev.ru> writes:

>  - compare function has third (optional) argument, of boolean type, it points to
>    kind of compare: partial or exact match. If argument is equal to 'false',
>    function should produce comparing as usual, else function's result is
>    treated as:
>        = 0  - match
>        < 0  - doesn't match but continue scan
>        > 0  - stop scan

Perhaps a minor point but I think this would be cleaner as a separate opclass
function with a separate support number rather than overloading the comparison
function.

Then if the support function is there it supports that type of scan and if it
doesn't then it doesn't, rather than depending on a magic third argument to
completely change behaviour.

You can always share code using an internal function or if the behaviour is
identical just register the same function twice.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's Slony Replication support!

pgsql-patches by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Indexam API changes
Next
From: Heikki Linnakangas
Date:
Subject: Re: Partial match in GIN