Received: from cvis28.marconicomms.com (cvis28.marconicomms.com [195.99.244.60]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f02ECSL79625 for ; Tue, 2 Jan 2001 09:12:29 -0500 (EST) (envelope-from Carl.Shelbourne@marconi.com) Received: from cvis01.gpt.co.uk (unverified) by cvis28.marconicomms.com (Content Technologies SMTPRS 4.1.5) with ESMTP id for ; Tue, 2 Jan 2001 14:11:58 +0000 Received: from marconicomms.com by cvis01.gpt.co.uk with SMTP (8.8.8+Sun/cvms-30) id OAA00652; Tue, 2 Jan 2001 14:11:57 GMT Received: by marconicomms.com(Lotus SMTP MTA v4.6.7 (934.1 12-30-1999)) id 802569C8.004DF67A ; Tue, 2 Jan 2001 14:11:33 +0000 X-Lotus-FromDomain: MCMAIN@MCEXT From: "Carl Shelbourne" To: pgsql-interfaces@postgresql.org Message-ID: <802569C8.004DF48F.00@marconicomms.com> Date: Tue, 2 Jan 2001 14:11:18 +0000 Subject: ODBC: how to establish primary key & indexes Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline X-Archive-Number: 200101/6 X-Sequence-Number: 613 I am trying to write a generic ODBC wrapper (on Solaris using unixODBC) in c++ and I need to query the DB to find out what fields are the primary key(s), and other unique indexes. I've tried querying pg_indexes but the indexfdef column is of datatype "text", not a SQL92 standard data type, which is returning a datatype of "-1". I am assuming I have missed something out in my configuration of the ODBC interface/driver???? Is there an easy way to query the db to find out the fields that are the primary key(s) and any other (unique) indexes that have been created using ODBC queries??? Thanks Carl