Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id A19CC475A38 for ; Sat, 22 Jun 2002 06:43:50 -0400 (EDT) Received: from mta05ps.bigpond.com (mta05ps.bigpond.com [144.135.25.137]) by postgresql.org (Postfix) with ESMTP id 1A1DE475987 for ; Sat, 22 Jun 2002 06:43:48 -0400 (EDT) Received: from hobbes ([144.135.25.72]) by mta05ps.bigpond.com (Netscape Messaging Server 4.15 mta05ps Apr 29 2002 13:22:02) with SMTP id GY3SH000.DNR; Sat, 22 Jun 2002 20:43:48 +1000 Received: from CPE-144-136-0-9.vic.bigpond.net.au ([144.136.0.9]) by PSMAM02.mailsvc.email.bigpond.com(MailRouter V3.0n 74/15324790); 22 Jun 2002 20:43:48 Message-ID: <006801c219d9$ba0b3710$fe00a8c0@hobbes> From: "Dmitri Colebatch" To: "Kris" , References: <009201c219d7$c6605420$30267bd5@graveland> Subject: Re: Obtaining primary key information from pg system tables Date: Sat, 22 Jun 2002 20:44:03 +1000 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0065_01C21A2D.8B5D4030" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 X-Archive-Number: 200206/310 X-Sequence-Number: 8275 This is a multi-part message in MIME format. ------=_NextPart_000_0065_01C21A2D.8B5D4030 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Kris, I'm assuming you dont want to do this, but just in case you're not aware of= the option - the JDBC API exposes this information.=20=20 hth dim ----- Original Message -----=20 From: Kris=20 To: pgsql-sql@postgresql.org=20 Sent: Saturday, June 22, 2002 8:30 PM Subject: [SQL] Obtaining primary key information from pg system tables Hi, I am trying to generate some xml metadata from the pg system tables for m= y java code generation utility. I have can get most information, but i woul= d like to be able to tell which column is a primary key or which one is a f= oreign key (i dont need to know which table the foreign key references at t= his point). Which tables do i need reference, could anyone provide an example query? Kris ------=_NextPart_000_0065_01C21A2D.8B5D4030 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Kris,
 
I'm assuming you dont want to do t= his, but=20 just in case you're not aware of the option - the JDBC API exposes this=20 information. 
 
hth
dim
----- Original Message -----
Fro= m:=20 Kris
To: pgsql-sql@postgresql.org
Sent: Saturday, June 22, 2002 8:30= =20 PM
Subject: [SQL] Obtaining primary k= ey=20 information from pg system tables

Hi,
 
I am trying to generate some xml metadat= a from=20 the pg system tables for my java code generation utility. I have can get = most=20 information, but i would like to be able to tell which column is a primar= y key=20 or which one is a foreign key (i dont need to know which table the foreig= n key=20 references at this point).
 
Which tables do i need reference, could = anyone=20 provide an example query?
 
Kris
------=_NextPart_000_0065_01C21A2D.8B5D4030--