Thread: How do i give comment for each Field

How do i give comment for each Field

From
Radha
Date:

Hi,

    I need to store some comments/definition for every field in a
table. Is there a way to give comment for the columns while creating the
table itself or after that?

I see something like 'Description' when i want to see the list of
tables/fields in the table using '\d'. Have anyone used this
'Description'?

Any help would be appreciated. Thanx in advance.

bye
Radha


Re: How do i give comment for each Field

From
"Thalis A. Kalfigopoulos"
Date:
On Mon, 16 Jul 2001, Radha wrote:

>
>
> Hi,
>
>     I need to store some comments/definition for every field in a
> table. Is there a way to give comment for the columns while creating the
> table itself or after that?
>
> I see something like 'Description' when i want to see the list of
> tables/fields in the table using '\d'. Have anyone used this
> 'Description'?
>
> Any help would be appreciated. Thanx in advance.

You can add comments for the fields after table creation using the COMMENT command in psql. Do \h COMMENT to see the
syntax.

cheers,
thalis

>
> bye
> Radha
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


Re: How do i give comment for each Field

From
Tom Lane
Date:
Radha <han_radha@yahoo.com> writes:
> I see something like 'Description' when i want to see the list of
> tables/fields in the table using '\d'. Have anyone used this
> 'Description'?

See

http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/sql-comment.html

            regards, tom lane