From: paallen@attglobal.net
To: pgsql-sql@postgresql.org
Subject: Query to return schema/table/columname/columntype
Date: Fri, 19 Jan 2007 12:41:19 +0000
Message-ID: <20070119124622.0DE929FB2A3@postgresql.org> (raw)
Hi all,
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.
For background I am selecting table & schema by
the query:
SELECT schemaname || '.' || tablename AS tablename
FROM pg_tables ORDER BY tablename;
Then I need to obtain the columns within that
table/schema. The original query was:
select c.oid,a.attname, t.typname
from pg_class c inner join pg_attribute a on
a.attrelid = c.oid inner join pg_type t on
a.atttypid = t.oid where c.relname = 'thetablename
and a.attnum > 0;
Now my problem is how to create a new column to
replace c.relname so I can query on
"theschemaname.thetablename".
Any suggestions will be welcomed. Thanks,
Phil
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: paallen@attglobal.net
Subject: Re: Query to return schema/table/columname/columntype
In-Reply-To: <20070119124622.0DE929FB2A3@postgresql.org>
* 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