Re: [GENERAL] list all columns in db

2007-06-11 Thread Jonathan Vanasco
Thank you Jon -- thats the exact sort of trick I was hoping for. Cheers! On Jun 7, 2007, at 6:36 PM, Jon Sime wrote: Jonathan Vanasco wrote: Does anyone have a trick to list all columns in a db ? No trickery, just exploit the availability of the SQL standard information_schema views:

Re: [GENERAL] list all columns in db

2007-06-08 Thread Peter Childs
On 07/06/07, Jon Sime [EMAIL PROTECTED] wrote: Jonathan Vanasco wrote: Does anyone have a trick to list all columns in a db ? No trickery, just exploit the availability of the SQL standard information_schema views: select table_schema, table_name, column_name from

Re: [GENERAL] list all columns in db

2007-06-08 Thread Andy Dale
In this query: select n.nspname as table_schema, c.relname as table_name, a.attname as column_name from pg_catalog.pg_attribute a join pg_catalog.pg_class c on ( a.attrelid = c.oid) join pg_catalog.pg_namespace n on (c.relnamespace = n.oid) where c.relkind in

[GENERAL] list all columns in db

2007-06-07 Thread Jonathan Vanasco
Does anyone have a trick to list all columns in a db ? I need to audit a few dbs to make sure column table names are adhering to our standard semantic syntax. i figure there has to be an old pg-admin trick out there to display a db like %(tname)s . %(cname) or some similar

Re: [GENERAL] list all columns in db

2007-06-07 Thread Rodrigo De León
Jonathan Vanasco ha escrito: Does anyone have a trick to list all columns in a db ? SELECT * FROM INFORMATION_SCHEMA.COLUMNS ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan

Re: [GENERAL] list all columns in db

2007-06-07 Thread Jon Sime
Jonathan Vanasco wrote: Does anyone have a trick to list all columns in a db ? No trickery, just exploit the availability of the SQL standard information_schema views: select table_schema, table_name, column_name from information_schema.columns where table_schema not in

Re: [GENERAL] list all columns in db

2007-06-07 Thread Michael Fuhr
On Thu, Jun 07, 2007 at 06:36:07PM -0400, Jon Sime wrote: select n.nspname as table_schema, c.relname as table_name, a.attname as column_name from pg_catalog.pg_attribute a join pg_catalog.pg_class c on (a.attrelid = c.oid) join pg_catalog.pg_namespace n on