Re: [GENERAL] What is the proper query

2017-08-23 Thread Igor Korot
Hi, On Tue, Aug 22, 2017 at 6:18 PM, Igor Korot wrote: > Melvin et al, > > On Tue, Aug 22, 2017 at 12:55 PM, Melvin Davidson > wrote: > >> >> >> >> *While the information_schema is useful, there is no substitute for >> learning how to use the

Re: [GENERAL] What is the proper query

2017-08-22 Thread Igor Korot
Melvin et al, On Tue, Aug 22, 2017 at 12:55 PM, Melvin Davidson wrote: > > > > *While the information_schema is useful, there is no substitute for > learning how to use the pg_catalog and system information functions.* > > > *See if this query gives you what you are

Re: [GENERAL] What is the proper query

2017-08-22 Thread Igor Korot
Hi, Melvin, On Tue, Aug 22, 2017 at 12:55 PM, Melvin Davidson wrote: > > > > *While the information_schema is useful, there is no substitute for > learning how to use the pg_catalog and system information functions.* > > > *See if this query gives you what you are looking

Re: [GENERAL] What is the proper query

2017-08-22 Thread David G. Johnston
On Mon, Aug 21, 2017 at 9:08 PM, Igor Korot wrote: > Hi, ALL, > draft=# SELECT * FROM information_schema.key_column_usage > ​[...]​ > There are 3 foreign keys in that table. > > Is there a way to get values of 0, 1, 1, and 2 for the ordinal position? > Not using the

Re: [GENERAL] What is the proper query

2017-08-22 Thread Melvin Davidson
*While the information_schema is useful, there is no substitute for learning how to use the pg_catalog and system information functions.* *See if this query gives you what you are looking for:* *SELECT rel.relname, con.conname, con.contype, con.consrc,

Re: [GENERAL] What is the proper query

2017-08-22 Thread Igor Korot
Hi, David, On Tue, Aug 22, 2017 at 12:06 PM, David G. Johnston wrote: > On Tue, Aug 22, 2017 at 8:43 AM, Igor Korot wrote: >> >> Or this is the bug in 9.1? >> Since it looks like there are 2 columns with the same info in 1 >> table/view > > >

Re: [GENERAL] What is the proper query

2017-08-22 Thread David G. Johnston
On Tue, Aug 22, 2017 at 8:43 AM, Igor Korot wrote: > Or this is the bug in 9.1? > Since it looks like there are 2 columns with the same info in 1 > table/view > ​This old email thread sounds similar to what you are describing here.

Re: [GENERAL] What is the proper query

2017-08-22 Thread Igor Korot
Or this is the bug in 9.1? Since it looks like there are 2 columns with the same info in 1 table/view Thank you. On Tue, Aug 22, 2017 at 12:08 AM, Igor Korot wrote: > Hi, ALL, > draft=# SELECT * FROM information_schema.key_column_usage WHERE > table_schema = 'public'

[GENERAL] What is the proper query

2017-08-21 Thread Igor Korot
Hi, ALL, draft=# SELECT * FROM information_schema.key_column_usage WHERE table_schema = 'public' AND table_name = 'leaguescorehitter'; constraint_catalog | constraint_schema |constraint_name | table_catalog | table_schema |table_name | column_name | ordinal_position |