"D'Arcy J.M. Cain" <darcy@druid.net> writes:
> That's a good question. The following query does this in a very
> unsatisfactory way. Anyone know what the general solution would be?
> ...
> (
> pg_index.indkey[0]=pg_attribute.attnum OR
> pg_index.indkey[1]=pg_attribute.attnum OR
> pg_index.indkey[2]=pg_attribute.attnum OR
> pg_index.indkey[3]=pg_attribute.attnum OR
> pg_index.indkey[4]=pg_attribute.attnum OR
> pg_index.indkey[5]=pg_attribute.attnum OR
> pg_index.indkey[6]=pg_attribute.attnum OR
> pg_index.indkey[7]=pg_attribute.attnum OR
> pg_index.indkey[8]=pg_attribute.attnum OR
> pg_index.indkey[9]=pg_attribute.attnum
> )
In CVS tip you could replace this with "attnum = ANY (indkey)".
Unfortunately, most array support doesn't work on int2vector in
pre-8.1 releases, so I think you're kinda stuck with the above
for now.
regards, tom lane