X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 976C152AC3 for ; Thu, 18 Aug 2005 17:08:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61667-08 for ; Thu, 18 Aug 2005 20:08:48 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id A08D25295C for ; Thu, 18 Aug 2005 17:08:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j7IK8gZ8010280; Thu, 18 Aug 2005 16:08:42 -0400 (EDT) To: "D'Arcy J.M. Cain" Cc: Roger Tannous , pgsql-sql@postgresql.org Subject: Re: A Table's Primary Key Listing In-reply-to: <20050818135524.74852123.darcy@druid.net> References: <20050818121844.33a09ad2.darcy@druid.net> <20050818164057.38362.qmail@web51906.mail.yahoo.com> <20050818135524.74852123.darcy@druid.net> Comments: In-reply-to "D'Arcy J.M. Cain" message dated "Thu, 18 Aug 2005 13:55:24 -0400" Date: Thu, 18 Aug 2005 16:08:42 -0400 Message-ID: <10279.1124395722@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200508/148 X-Sequence-Number: 22376 "D'Arcy J.M. Cain" 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