Re: Query to return schema/table/columname/columntype - Mailing list pgsql-sql

From chester c young
Subject Re: Query to return schema/table/columname/columntype
Date
Msg-id 176107.34655.qm@web54312.mail.yahoo.com
Whole thread Raw
In response to Query to return schema/table/columname/columntype  (paallen@attglobal.net)
List pgsql-sql
> I am trying to modify the dabo (a python wxpython
> ide for database forms creation) code to allow the
> selection of tables in any schema.  I need a query
> that will return records with schema, table,
> columname and columne type.


create view pg_cols as select       s.nspname as schema_nm,       r.relname as table_nm,       a.attnum as column_sq,
   a.attname as column_nm,       t.typname as datatype,       a.atttypmod as datalen
 
from    pg_attribute a
join    pg_type t on( t.oid = a.atttypid )
join    pg_class r on( r.oid = a.attrelid )
join    pg_namespace s on( s.oid = r.relnamespace )
where   a.attnum > 0
and     r.relkind = 'r'
and     s.nspname = :schemaq;




____________________________________________________________________________________
Finding fabulous fares is fun.  
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
http://farechase.yahoo.com/promo-generic-14795097


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Query to return schema/table/columname/columntype
Next
From: "codeWarrior"
Date:
Subject: Re: Query to return schema/table/columname/columntype