Re: Retrieving database schema - Mailing list pgsql-general

From Gary M
Subject Re: Retrieving database schema
Date
Msg-id Pine.LNX.4.44.0303222238550.26061-100000@ruby.gem
Whole thread Raw
In response to Re: Retrieving database schema  (Lamar Owen <lamar.owen@wgcr.org>)
Responses Re: Retrieving database schema  (Lamar Owen <lamar.owen@wgcr.org>)
List pgsql-general
Thanks, the syntax works fine on 7.3.2.

Note that "lower($table)" may not be desirable as you CAN create
mixed-case table and column names, for example...

 CREATE TABLE "MixedCase" ( "MixedCase" serial );

On Sat, 22 Mar 2003, Lamar Owen wrote:

> I use the following query, which also gives the type of the column. $table is
> the table in question.
> SELECT a.attname, t.typname
>               FROM pg_class c, pg_attribute a, pg_type t
>                         WHERE c.relname = lower($table)
>                                      and a.attnum > 0 and a.attrelid = c.oid
>                                      and a.atttypid = t.oid
> ORDER BY attname


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Retrieving database schema
Next
From: "Thomas T. Thai"
Date:
Subject: Crash After Vacuum Analyze