Re: Insert a description while creating a table

From: Reinoud van Leeuwen <reinoud(dot)v(at)n(dot)leeuwen(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Insert a description while creating a table
Date: 2003-08-13 13:11:27
Message-ID: 20030813151127.O20464@spoetnik.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Aug 13, 2003 at 02:54:59PM +0200, Christoph Haller wrote:
> \dd test shows
>
> Object descriptions
> Schema | Name | Object | Description
> --------+------+--------+-------------
> (0 rows)
>
> This is odd. OK, I know the doc says
> \dd [ pattern ]
>
> Shows the descriptions of objects matching the pattern, or of all
> visible objects if no argument is given. But in either case,
> only objects that have a description are listed. ("Object" covers
> aggregates, functions, operators, types, relations (tables, views,
> indexes, sequences, large objects), rules, and triggers.) For
> example:
>
> Nothing about columns.
> But what is the purpose of comments on columns if you can only get them
> via
> select * from pg_description where

Have you tried \d+ tablename? (sorry for the long lines ";-)

drbob=# \dd object
Object descriptions
Schema | Name | Object | Description
--------+--------+--------+-------------------------------------------------
public | object | table | The table that holds all instances of objects.
(1 row)

drbob=# \d+ object

Table "public.object"
Column | Type |
Modifiers |
Description
------------------+-----------------------------+----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------
id | integer | not null default
nextval('shared_ids'::text) | (global) unique ID for this table
object_def_id | integer | not null
| foreign key to object_def.id
name | character varying(60) |
| natural name of this object
superobject_id | integer |
| foreign key to object.id. This field is only filled in when the this
object is a subobject of another object (EG a port in a router)
subobject_def_id | integer |
| foreign key to subobject_def.id. This field is only filled in when this
object is a subobject of another object (EG a port in a router)
has_subobject | boolean | not null default 'FALSE'
| boolean indicating that this object instance has subobjects (EG router
that has ports)
date_added | timestamp without time zone |
| date this record was added to the database
user_added | character varying(20) |
| username that added this record to the database
date_changed | timestamp without time zone |
| date this record was last changed
user_changed | character varying(20) |
| username that made the last change to this record
Indexes: pk_object primary key btree (id),
object_pk unique btree (id),
object_object_def_fk btree (object_def_id),
object_object_fk btree (superobject_id),
object_subobject_def_fk btree (subobject_def_id)
Triggers: tdb_object,
tiua_object,
tiub_object
--
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen reinoud(dot)v(at)n(dot)leeuwen(dot)net
http://www.xs4all.nl/~reinoud
__________________________________________________

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message krystoffff 2003-08-13 13:20:43 Re: How to optimize this query ?
Previous Message luiz 2003-08-13 13:05:26 Re: Insert a description while creating a table