Re: Display of foreign keys in psql - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Display of foreign keys in psql
Date
Msg-id 4136ffa0906101515i36a425c2kc72cc5289f88e1cc@mail.gmail.com
Whole thread Raw
In response to Re: Display of foreign keys in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Display of foreign keys in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Jun 10, 2009 at 11:04 PM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
>
> Or use TABLE:
>
>  "test2_y_fkey" TABLE test2 FOREIGN KEY (y) REFERENCES test1(a)

Hm, one of the things a lot of people said they liked about the
existing list is that it was almost copy-pastable as the command to
recreate the constraint. If we use "TABLE" it might make sense to
reorder things so that it matches the command.

The command that would recreate this constraint is:

ALTER TABLE test2 ADD CONSTRAINT test2_y_fkey FOREIGN KEY (y)
REFERENCES test1(a);

So perhaps something like:

Referenced by:

TABLE test2 CONSTRAINT test2_y_fkey FOREIGN KEY (y) REFERENCES test1(a);


--
Gregory Stark
http://mit.edu/~gsstark/resume.pdf


pgsql-hackers by date:

Previous
From: Brendan Jurd
Date:
Subject: Re: Display of foreign keys in psql
Next
From: Tom Lane
Date:
Subject: Re: Not quite a security hole in internal_in