Skip site navigation (1) Skip section navigation (2)

Re: find foreign key name

From: Tore Halset <halset(at)pvv(dot)ntnu(dot)no>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: find foreign key name
Date: 2007-12-18 14:43:24
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
On Dec 18, 2007, at 10:36 , Heikki Linnakangas wrote:

> Tore Halset wrote:
>> I want to programatically drop a foreign key constraint via jdbc.  
>> How can I find the foreign key name for a PostgreSQL foreign key  
>> via jdbc? I know all about the related tables and columns, but not  
>> the name of the constraint.
> You can query the pg_constraint catalog table:
> There seems to be some example queries in the user comments that you  
> might be interested.

Thanks. I was hoping for something easy in  
DatabaseMetaData#getExportedKeys.. :) But looking at pg_constraint  
should work fine.

  - Tore.

In response to


pgsql-jdbc by date

Next:From: Kris JurkaDate: 2007-12-18 16:05:07
Subject: Re: find foreign key name
Previous:From: tivvpgsqljdbcDate: 2007-12-18 11:28:03
Subject: Re: concat returns null

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group