pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_ ?
7+ messages / 4 participants
[nested] [flat]

* pg_ ?
@ 2003-05-06 12:02 Popeanga Marian <pmarian@cnlo.ro>
  2003-05-06 12:59 ` Re: pg_ ? Rajesh Kumar Mallah <mallah@trade-india.com>
  2003-05-06 13:22 ` Re: pg_ ? A.Bhuvaneswaran <bhuvansql@myrealbox.com>
  2003-05-06 17:48 ` Re: pg_ ? Achilleus Mantzios <achill@matrix.gatewaynet.com>
  0 siblings, 3 replies; 7+ messages in thread

From: Popeanga Marian @ 2003-05-06 12:02 UTC (permalink / raw)
  To: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_ ?
  2003-05-06 12:02 pg_ ? Popeanga Marian <pmarian@cnlo.ro>
@ 2003-05-06 12:59 ` Rajesh Kumar Mallah <mallah@trade-india.com>
  2003-05-07 11:35   ` Re: pg_ ? Popeanga Marian <pmarian@cnlo.ro>
  2 siblings, 1 reply; 7+ messages in thread

From: Rajesh Kumar Mallah @ 2003-05-06 12:59 UTC (permalink / raw)
  To: Popeanga Marian <pmarian@cnlo.ro>; pgsql-sql



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.




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_ ?
  2003-05-06 12:02 pg_ ? Popeanga Marian <pmarian@cnlo.ro>
  2003-05-06 12:59 ` Re: pg_ ? Rajesh Kumar Mallah <mallah@trade-india.com>
@ 2003-05-07 11:35   ` Popeanga Marian <pmarian@cnlo.ro>
  0 siblings, 0 replies; 7+ messages in thread

From: Popeanga Marian @ 2003-05-07 11:35 UTC (permalink / raw)
  To: Rajesh Kumar Mallah <mallah@trade-india.com>; +Cc: pgsql-sql



Rajesh Kumar Mallah wrote:

>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.
>  
>
Thanks guys,  This -E option i didn'tknow about it!

>
>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

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_ ?
  2003-05-06 12:02 pg_ ? Popeanga Marian <pmarian@cnlo.ro>
@ 2003-05-06 13:22 ` A.Bhuvaneswaran <bhuvansql@myrealbox.com>
  2003-05-06 13:36   ` Re: pg_ ? A.Bhuvaneswaran <bhuvansql@myrealbox.com>
  2003-05-06 18:46   ` Re: pg_ ? Achilleus Mantzios <achill@matrix.gatewaynet.com>
  2 siblings, 2 replies; 7+ messages in thread

From: A.Bhuvaneswaran @ 2003-05-06 13:22 UTC (permalink / raw)
  To: Popeanga Marian <pmarian@cnlo.ro>; +Cc: 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.

regards,
bhuvaneswaran




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_ ?
  2003-05-06 12:02 pg_ ? Popeanga Marian <pmarian@cnlo.ro>
  2003-05-06 13:22 ` Re: pg_ ? A.Bhuvaneswaran <bhuvansql@myrealbox.com>
@ 2003-05-06 13:36   ` A.Bhuvaneswaran <bhuvansql@myrealbox.com>
  1 sibling, 0 replies; 7+ messages in thread

From: A.Bhuvaneswaran @ 2003-05-06 13:36 UTC (permalink / raw)
  To: Popeanga Marian <pmarian@cnlo.ro>; +Cc: 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




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_ ?
  2003-05-06 12:02 pg_ ? Popeanga Marian <pmarian@cnlo.ro>
  2003-05-06 13:22 ` Re: pg_ ? A.Bhuvaneswaran <bhuvansql@myrealbox.com>
@ 2003-05-06 18:46   ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Achilleus Mantzios @ 2003-05-06 18:46 UTC (permalink / raw)
  To: A.Bhuvaneswaran <bhuvansql@myrealbox.com>; +Cc: Popeanga Marian <pmarian@cnlo.ro>; pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_ ?
  2003-05-06 12:02 pg_ ? Popeanga Marian <pmarian@cnlo.ro>
@ 2003-05-06 17:48 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
  2 siblings, 0 replies; 7+ messages in thread

From: Achilleus Mantzios @ 2003-05-06 17:48 UTC (permalink / raw)
  To: Popeanga Marian <pmarian@cnlo.ro>; +Cc: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2003-05-07 11:35 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-05-06 12:02 pg_ ? Popeanga Marian <pmarian@cnlo.ro>
2003-05-06 12:59 ` Rajesh Kumar Mallah <mallah@trade-india.com>
2003-05-07 11:35   ` Popeanga Marian <pmarian@cnlo.ro>
2003-05-06 13:22 ` A.Bhuvaneswaran <bhuvansql@myrealbox.com>
2003-05-06 13:36   ` A.Bhuvaneswaran <bhuvansql@myrealbox.com>
2003-05-06 18:46   ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
2003-05-06 17:48 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>

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