RE: [INTERFACES] JDBC primary keys - Mailing list pgsql-interfaces

From Peter Mount
Subject RE: [INTERFACES] JDBC primary keys
Date
Msg-id 1B3D5E532D18D311861A00600865478C70C1A5@exchange1.nt.maidstone.gov.uk
Whole thread Raw
Responses Re: [INTERFACES] JDBC primary keys  ("Alex Verstak" <averstak@vt.edu>)
List pgsql-interfaces
What version of the driver are you using? Earlier versions had some
problems and this one (returning `foo_pk' for all rows) looks like one
of them.

Peter

-- 
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council.



-----Original Message-----
From: Alex Verstak [mailto:averstak@vt.edu]
Sent: Wednesday, February 09, 2000 11:51 PM
To: pgsql-interfaces@postgreSQL.org
Subject: [INTERFACES] JDBC primary keys


 Is there a way to determine all primary key columns in a given table?  Example:  CREATE TABLE foo (   bar1 int4,
bar2text,   bar3 float8,   CONSTRAINT foo_pk PRIMARY KEY ( bar1, bar2 ) )  I want to obtain `bar1' and `bar2' given
tablename `foo'.  DatabaseMetaData.getPrimaryKeys looks like the right function to use, but it returns `foo_pk' in
COLUMN_NAMEfor all rows.  Am I misinterpreting the JDBC specs?  What SELECT query should I use to get the primary key
columns?

-- 
Drive^H^Hnk safely!
Alex Verstak                        averstak@vt.edu
1078 Ambler Johnston East             Virginia Tech
Blacksburg, VA 24060-0022       Tel. (540) 232-1389



************


pgsql-interfaces by date:

Previous
From: Dave Page
Date:
Subject: RE: [INTERFACES] pgAdmin on NT (NT4SP6)
Next
From: Peter Mount
Date:
Subject: RE: [INTERFACES] ConnectionPoolDataSource (JDBC)