Skip site navigation (1) Skip section navigation (2)

Re: dictionary?

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Ray Stell <stellr(at)cns(dot)vt(dot)edu>, pgsql-novice(at)postgresql(dot)org
Subject: Re: dictionary?
Date: 2006-09-22 19:28:50
Message-ID: 20060922192850.10231.qmail@web31809.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
> How do you accomplish this in pg?
> 
> 1. Is there a table like the Oracle dictionary?
> 2. Is there a way to describe a table?
> 
> I use these all the time in oracle.  When I can't remember where
> some management metric is located in the system, I sort of grep for 
> it based on a keyword.  For example, if I need to find out about some 
> snapshot (copy of a table from another db), I do this:
> 
> 
> select table_name from dictionary where table_name like '%SNAPSHOT%';
> 
> TABLE_NAME
> ------------------------------
> ALL_REGISTERED_SNAPSHOTS
> ALL_SNAPSHOTS
> ... 
> 
> 
> SQL> describe ALL_SNAPSHOTS
>  Name                                      Null?    Type
>  ----------------------------------------- -------- ---------------------------- 
>  OWNER                                     NOT NULL VARCHAR2(30)
>  NAME                                      NOT NULL VARCHAR2(30)
>  TABLE_NAME                                NOT NULL VARCHAR2(30)
> ...
> 
> 
> select name from ALL_SNAPSHOTS;
> ...


How about:

\d tablename
\dt tablename

For more information check out the "Meta-Commands" from:
http://www.postgresql.org/docs/8.1/interactive/app-psql.html

Regards,

Richard Broersma Jr.

In response to

pgsql-novice by date

Next:From: Tomeh, HusamDate: 2006-09-22 19:40:35
Subject: Re: dictionary?
Previous:From: Ray StellDate: 2006-09-22 19:16:22
Subject: dictionary?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group