FW: information about tables via psql - Mailing list pgsql-general

From Markova, Nina
Subject FW: information about tables via psql
Date
Msg-id 6D8C7E015447D0428D80E9DBABA06A1E0464D5B8@S0-OTT-X2.nrn.nrcan.gc.ca
Whole thread Raw
Responses Re: FW: information about tables via psql  (Sam Mason <sam@samason.me.uk>)
List pgsql-general

Hi,

I am in process of learning psql. I'm trying to extract information about tables - as many details as possible.  Something similar to what I'm used to see using Ingres RDBMS - table structure, creation date, number of rows, primary keys, is it journalled, etc. In Ingres in order to see that information I use commands 'help <tablename>' and more detailed version 'help table <tablename>'. Is there any postgres equivalent of these commands?

With psql I used '\d <tablename>' and '\d+ <tablename'.  None of those showed me what I need.  See below.

Thanks in advance,
Nina

eq=# \d+ c_ass \g
                           Table "public.c_ass"
   Column    |     Type      |          Modifiers           | Description
-------------+---------------+------------------------------+-------------
 arrid       | character(16) | not null                     |
 solid       | character(16) | not null                     |
 wt_flag     | character(1)  | not null default ' '::bpchar |
 res         | real          |                              |
 wt          | real          |                              |
 dist        | real          |                              |
 az          | real          |                              |
 octant      | character(2)  | not null default ' '::bpchar |
 mag1        | real          |                              |
 av_mag1_flg | character(1)  | not null default ' '::bpchar |
 mag1type    | character(4)  | not null default ' '::bpchar |
 mag1_res    | real          | not null default 0           |
 cphase      | character(8)  | not null default ' '::bpchar |
 emerang     | real          |                              |
 delta       | real          |                              |
Has OIDs: no

Ingres
=====

* help c_ass \g
Executing . . .

Name:                 c_ass
Owner:                dba
Created:              2008-05-02 10:03:09     
Type:                 user table
Version:              II2.6

Column Information:
                                                                  Key
Column Name                      Type       Length Nulls Defaults Seq
arrid                            char           16   no      no     2
solid                            char           16   no      no     1
wt_flag                          char            1   no     yes      
res                              float           4  yes    null      
wt                               float           4  yes    null      

* help table c_ass \g
Executing . . .

Name:                 c_ass
Owner:                dba
Created:              2008-05-02 10:03:09     
Location:             ii_database
Type:                 user table
Version:              II2.6
Page size:            8192
Cache priority:       0
Alter table version:  0
Alter table totwidth: 87
Row width:            87
Number of rows:       3350762
Storage structure:    btree
Compression:          none
Duplicate Rows:       not allowed
Number of pages:      83329
Overflow data pages:  0
Journaling:           enabled
Base table for view:  no
Optimizer statistics: none

Column Information:
                                                                  Key
Column Name                      Type       Length Nulls Defaults Seq
arrid                            char           16   no      no     2
solid                            char           16   no      no     1
wt_flag                          char            1   no     yes      
res                              float           4  yes    null      
wt                               float           4  yes    null      

Secondary indexes:
Index Name                       Structure  Keyed On
c_ass_idx                        isam       arrid, solid

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: Varchar vs text
Next
From: Devrim GÜNDÜZ
Date:
Subject: Re: Serial Jumping