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

Re: Viewing Foreign key constraints in psql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com>
Cc: PostgreSQL Mailing List <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Viewing Foreign key constraints in psql
Date: 2002-11-22 15:18:06
Message-ID: 23980.1037978286@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com> writes:
>   How do I view the foreign key constraints (name and
> definition) in psql? I can only see the triggers
> created by the constraint when I use the "\d <table>"
> command in psql.

In PG versions < 7.3, you don't: the system doesn't retain any concept
of the foreign key constraint as such, only the triggers that implement
it.  In 7.3 there is a pg_constraint table with an actual entry for each
foreign key constraint.

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2002-11-22 16:41:38
Subject: Re: How does "SELECT ... FOR UPDATE" work?
Previous:From: Joshua Daniel FranklinDate: 2002-11-22 15:13:19
Subject: How does "SELECT ... FOR UPDATE" work?

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