pg_ ?
pg_ ?
От:
Popeanga Marian <pmarian@cnlo.ro>
Дата:
Hello all,
Witch is the system view from where i can get columns for all
tables and views ?
Just like when pgsql> \d view
--
Popeanga Marian
DBA Oracle
CNLO Romania
Re: pg_ ?
От:
Achilleus Mantzios <achill@matrix.gatewaynet.com>
Дата:
On Tue, 6 May 2003, Popeanga Marian wrote: > Hello all, > > > Witch is the system view from where i can get columns for all > tables and views ? > Just like when pgsql> \d view refine (get rid of cmax/cmin.....) something like: SELECT relname,attname from pg_attribute,pg_class where attrelid = pg_class.oid order by relname,attname; > > -- ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-210-8981112 fax: +30-210-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr
Re: pg_ ?
От:
Rajesh Kumar Mallah <mallah@trade-india.com>
Дата:
pg_attribute. in general if you start psql with -E option psql will print the various queries which it uses on system catalogs for displaying various kind of information. Regds mallah. On Tuesday 06 May 2003 5:32 pm, Popeanga Marian wrote: > Hello all, > > > Witch is the system view from where i can get columns for all > tables and views ? > Just like when pgsql> \d view -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.
Re: pg_ ?
От:
"A.Bhuvaneswaran" <bhuvansql@myrealbox.com>
Дата:
> 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. regards, bhuvaneswaran
Re: pg_ ?
От:
"A.Bhuvaneswaran" <bhuvansql@myrealbox.com>
Дата:
> > 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
Re: pg_ ?
От:
Achilleus Mantzios <achill@matrix.gatewaynet.com>
Дата:
On Tue, 6 May 2003, A.Bhuvaneswaran wrote: > > 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. Well just try: SELECT relname,attname||' : '||typname from pg_attribute,pg_class,pg_type where attrelid = pg_class.oid and attnum > 1 and atttypid = pg_type.oid order by relname,attname; > > regards, > bhuvaneswaran > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > -- ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-210-8981112 fax: +30-210-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr
Re: pg_ ?
От:
Popeanga Marian <pmarian@cnlo.ro>
Дата:
Rajesh Kumar Mallah wrote:Thanks guys, This -E option i didn'tknow about it!pg_attribute. in general if you start psql with -E option psql will print the various queries which it uses on system catalogs for displaying various kind of information.Regds mallah. On Tuesday 06 May 2003 5:32 pm, Popeanga Marian wrote:Hello all, Witch is the system view from where i can get columns for all tables and views ? Just like when pgsql> \d view-- Popeanga Marian DBA Oracle CNLO Romania