Re: pg_ ? - Mailing list pgsql-sql

From A.Bhuvaneswaran
Subject Re: pg_ ?
Date
Msg-id Pine.LNX.4.44.0305061903250.1500-100000@Bhuvan.bksys.co.in
Whole thread Raw
In response to Re: pg_ ?  ("A.Bhuvaneswaran" <bhuvansql@myrealbox.com>)
List pgsql-sql
> >            Witch is the system view from where i can get columns for all 
> > tables and views ?
> > Just like when pgsql> \d view
> 
> pg_class is the *system table* from which you can get the columns of all
             ^^^^^^^!
 
> tables and views.

Sorry. It is details, not columns. To get columns we can use pg_attribute
system table. For example the below sql would get the column names,

select c.relname, a.attname from pg_class c, pg_attribute a, pg_namespace
n where c.oid = a.attrelid and a.attnum > 0 and c.relnamespace = n.oid and
n.nspname = 'my_schema' and c.relname = 'my_table';

=> \d pg_attribute -- for more details

regards,
bhuvaneswaran



pgsql-sql by date:

Previous
From: "A.Bhuvaneswaran"
Date:
Subject: Re: pg_ ?
Next
From: Achilleus Mantzios
Date:
Subject: Re: pg_ ?