Re: SQL statement : list table details - Mailing list pgsql-general

From Samik Raychauhduri
Subject Re: SQL statement : list table details
Date
Msg-id 3C7ED25F.8020104@cae.wisc.edu
Whole thread Raw
Responses Re: SQL statement : list table details
Re: SQL statement : list table details
List pgsql-general
Hi,
Thanks for this query BTW, I was looking for a query like this :)
Let's see if anybody comes up with any solution to the data types.
-samik

Dino Hoboloney wrote:

>     I am looking for a SQL statement which would list table names, columns,
> and column types of a specific DB. So far I have managed to find a statement
> that lists all of the tables and columns in the DB with
>
> SELECT a.attnum, a.attname AS field, c.relname AS table_name FROM pg_class
> c, pg_attribute a WHERE c.relname NOT LIKE 'pg%' AND relkind = 'r' AND
> a.attnum > 0 AND a.attrelid = c.oid ORDER BY table_name, attnum;
>
> unfortunately I am unable to come up with a solution to listing the data
> types for the columns listed. Any ideas?
>
>
>



pgsql-general by date:

Previous
From: Richard Emberson
Date:
Subject: bulk insertions in PL/pgsql functions
Next
From: Neil Conway
Date:
Subject: Re: SQL statement : list table details