Re: dictionary? - Mailing list pgsql-novice

From Ray Stell
Subject Re: dictionary?
Date
Msg-id 20060922194929.GE11163@cns.vt.edu
Whole thread Raw
In response to Re: dictionary?  ("Tomeh, Husam" <htomeh@firstam.com>)
Responses Re: dictionary?
List pgsql-novice
cool:

template1=#  Select tablename from pg_tables where tablename like '%features%';
  tablename
--------------
 sql_features
(1 row)

template1=# \d sql_features
Did not find any relation named "sql_features".


template1=# \dT+sql_features
                                                           List of data types
   Schema   |            Name             |  Internal name   | Size |                            Description

------------+-----------------------------+------------------+------+-------------------------------------------------------------------
 pg_catalog | abstime                     | abstime          | 4    | absolute, limited-range date and time (Unix
systemtime) 
 pg_catalog | aclitem                     | aclitem          | 12   | access control list
....






On Fri, Sep 22, 2006 at 12:40:35PM -0700, Tomeh, Husam wrote:
>
> You can query pg_tables, pg_indexes, etc.
>
>     Select tablename from pg_tables where tablename like 'snapshot%' ;
>
> These views are based on the pg_class system table.
>
> To describe a table, just do  \d tablename.
>
> --
>   Husam
>   http://firstdba.googlepages.com
>
>
> -----Original Message-----
> From: pgsql-novice-owner@postgresql.org
> [mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Ray Stell
> Sent: Friday, September 22, 2006 12:16 PM
> To: pgsql-novice@postgresql.org
> Subject: [NOVICE] dictionary?
>
> 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;
> ...
>
> TIA.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
> **********************************************************************
> This message contains confidential information intended only for the use of the addressee(s) named above and may
containinformation that is legally privileged.  If you are not the addressee, or the person responsible for delivering
itto the addressee, you are hereby notified that reading, disseminating, distributing or copying this message is
strictlyprohibited.  If you have received this message by mistake, please immediately notify us by replying to the
messageand delete the original message immediately thereafter. 
>
> Thank you.
>
>                                    FADLD Tag
> **********************************************************************
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org

--

pgsql-novice by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: dictionary?
Next
From: Tom Lane
Date:
Subject: Re: dictionary?