pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chester c young <chestercyoung@yahoo.com>
To: paallen@attglobal.net
To: pgsql-sql@postgresql.org
Subject: Re: Query to return schema/table/columname/columntype
Date: Fri, 19 Jan 2007 08:28:53 -0800 (PST)
Message-ID: <176107.34655.qm@web54312.mail.yahoo.com> (raw)
In-Reply-To: <20070119124622.0DE929FB2A3@postgresql.org>


> 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



view thread (5+ messages)  latest in thread

Message-ID: <176107.34655.qm@web54312.mail.yahoo.com>
Permalink:  ../176107.34655.qm@web54312.mail.yahoo.com/
Also on:    postgresql.org/message-id/176107.34655.qm@web54312.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: chestercyoung@yahoo.com, paallen@attglobal.net
  Subject: Re: Query to return schema/table/columname/columntype
  In-Reply-To: <176107.34655.qm@web54312.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox