Received: from necker.ac-rouen.fr (smtp.ac-rouen.fr [194.167.110.3]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f51DoeE92179 for ; Fri, 1 Jun 2001 09:50:40 -0400 (EDT) (envelope-from david.bouriaud@ac-rouen.fr) Received: from ac-rouen.fr (localhost.localdomain [127.0.0.1]) by necker.ac-rouen.fr (8.11.0/8.11.0) with ESMTP id f51Dq6K26487 for ; Fri, 1 Jun 2001 15:52:06 +0200 Message-ID: <3B179E1F.4F9D8A4B@ac-rouen.fr> Date: Fri, 01 Jun 2001 15:52:31 +0200 From: David BOURIAUD X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.14 i686) X-Accept-Language: fr, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Problem with pg_index. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200106/1 X-Sequence-Number: 3204 Hi the list ! I'm new to this list. I've tried to write a sql query to get all the fields of a table and to have mentionned is a field can be null or not, and if a field is a key or not. Before showing the query I send, let me tell you that I'm running postgre v7.1.2 on a SuSE Linux 6.4 box, and that everything works fine but this query. Here it is : select pg_class.oid, pg_attribute.attname, pg_attribute.attbyval, pg_attribute.attnotnull from pg_class, pg_attribute, pg_index where relname='essai2' and pg_attribute.attrelid=pg_class.oid and pg_attribute.attnum >0 and pg_index.indrelid=pg_class.oid and pg_index.indkey[0] = pg_attribute.attnum This query doesn't work, the back-end answers Error : Invalid Command name "0"... What now ? I've checked out the online doc, and the archives of this list (that's where I got pg_index.indkey[0] from), but nothing seems to work, since pg_index.indkey seems to be an int2vector, and I found no integrated function to check if a value is in this vector... Thanks for your ideas and//or help. -- David BOURIAUD ---------------------------------------------------------- In a world without walls or fences, what use do we have for windows or gates ? ---------------------------------------------------------- ICQ#102562021