[HACKERS] Display of foreign keys in psql

2009-06-10 Thread Peter Eisentraut
I'm having trouble coming up with a sensible translation for the last line of this: peter=# \d test* Table public.test1 Column | Type | Modifiers +-+--- a | integer | not null Indexes: test1_pkey PRIMARY KEY, btree (a) Referenced by: test2_y_fkey IN

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Bruce Momjian
Peter Eisentraut wrote: I'm having trouble coming up with a sensible translation for the last line of this: peter=# \d test* Table public.test1 Column | Type | Modifiers +-+--- a | integer | not null Indexes: test1_pkey PRIMARY KEY, btree (a)

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Kevin Grittner
Bruce Momjian br...@momjian.us wrote: Peter Eisentraut wrote: Indexes: test1_pkey PRIMARY KEY, btree (a) Referenced by: test2_y_fkey IN test2 FOREIGN KEY (y) REFERENCES test1(a) Is there a magic reason why the IN is capitalized? should be lowercase. What about PRIMARY KEY,

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: Referenced by: test2_y_fkey IN test2 FOREIGN KEY (y) REFERENCES test1(a) Is there a magic reason why the IN is capitalized? (Maybe from would be better anyway?) I think it was probably done to make it more visually distinct from the adjacent

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Greg Stark
On Wed, Jun 10, 2009 at 10:58 PM, Bruce Momjianbr...@momjian.us wrote: Is there a magic reason why the IN is capitalized?  (Maybe from would be better anyway?) Probably not.  They were used to capitalizing IN for a subquery and it carried over;   should be lowercase. Well in that line

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Brendan Jurd
2009/6/11 Peter Eisentraut pete...@gmx.net: Referenced by:  test2_y_fkey IN test2 FOREIGN KEY (y) REFERENCES test1(a) Is there a magic reason why the IN is capitalized?  (Maybe from would be better anyway?) Isn't on the conventional preposition to use here? I would think of this as a

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Greg Stark
On Wed, Jun 10, 2009 at 11:04 PM, Tom Lanet...@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

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Tom Lane
Greg Stark st...@enterprisedb.com writes: So perhaps something like: Referenced by: TABLE test2 CONSTRAINT test2_y_fkey FOREIGN KEY (y) REFERENCES test1(a); +1 ... although making it *really* copy-and-pastable would require a bit more attention to detail than I bet it's gotten. (Schema

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Greg Stark
On Wed, Jun 10, 2009 at 11:21 PM, Tom Lanet...@sss.pgh.pa.us wrote: Greg Stark st...@enterprisedb.com writes: So perhaps something like: Referenced by: TABLE test2 CONSTRAINT test2_y_fkey FOREIGN KEY (y) REFERENCES test1(a); +1 ... although making it *really* copy-and-pastable would

Re: [HACKERS] Display of foreign keys in psql

2009-06-10 Thread Tom Lane
Greg Stark st...@enterprisedb.com writes: On Wed, Jun 10, 2009 at 11:21 PM, Tom Lanet...@sss.pgh.pa.us wrote: Greg Stark st...@enterprisedb.com writes: TABLE test2 CONSTRAINT test2_y_fkey FOREIGN KEY (y) REFERENCES test1(a); +1 Even there the TABLE is kind of optional. It would stlil make