Re: Display of foreign keys in psql

From: Greg Stark <stark(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Display of foreign keys in psql
Date: 2009-06-10 22:15:47
Message-ID: 4136ffa0906101515i36a425c2kc72cc5289f88e1cc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 10, 2009 at 11:04 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-06-10 22:16:32 Re: Not quite a security hole in internal_in
Previous Message Brendan Jurd 2009-06-10 22:08:42 Re: Display of foreign keys in psql