Re: need query advice

From: Pierre-Frédéric Caillaud <lists(at)boutiquenumerique(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: need query advice
Date: 2004-10-20 00:14:40
Message-ID: opsf46yqxrcq72hf@musicbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


argh, you could use contribs/intarray with a gist index...
instead of N columns use an integer[] and gist-index it, then write the
equivalent of :

where (intersection of the search array with the data array) has at least
5 elements
(or 4 elements)

(or at least 4 elements order by the number of elements desc)

in your table defs, you can express your unicity constraint on the array
with :
CHECK( uniq(yourarrau) = yourarrau AND length(yourarrau)=6 )

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Postgres User 2004-10-20 02:41:11 Which type of functions are best?
Previous Message lorid 2004-10-19 23:08:24 Re: help with to_date and to_char