Re: Adding notes against fields

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Adding notes against fields
Date: 2008-04-24 18:28:16
Message-ID: 60tzhr6rb3.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

oliver(at)blue-emu(dot)net (Oliver Helm) writes:

> Hello,
>
>
>
> I was wondering if if is possible to add a note against a field on a postgresql table?  
>
>
>
> For example when running "\d tablename" i would like to have and additional column called 'notes' which i could add to by altering the table.  As the note would
> be field specific, not row specific i would rather not have to do it with an additional column in the table!
>
>
>
> I have tried searching though the documentation, but so far have no found anything.  Can anyone suggest whether this is in fact possible, and point me in the right
> direction?

Have you taken a look at the COMMENT statement?

test(at)[local]:5432=# \h comment
Command: COMMENT
Description: define or change the comment of an object
Syntax:
COMMENT ON
{
TABLE object_name |
COLUMN table_name.column_name |
AGGREGATE agg_name (agg_type [, ...] ) |
CAST (sourcetype AS targettype) |
CONSTRAINT constraint_name ON table_name |
CONVERSION object_name |
DATABASE object_name |
DOMAIN object_name |
FUNCTION func_name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) |
INDEX object_name |
LARGE OBJECT large_object_oid |
OPERATOR op (leftoperand_type, rightoperand_type) |
OPERATOR CLASS object_name USING index_method |
[ PROCEDURAL ] LANGUAGE object_name |
ROLE object_name |
RULE rule_name ON table_name |
SCHEMA object_name |
SEQUENCE object_name |
TABLESPACE object_name |
TRIGGER trigger_name ON table_name |
TYPE object_name |
VIEW object_name
} IS 'text'

--
let name="cbbrowne" and tld="acm.org" in name ^ "@" ^ tld;;
http://www3.sympatico.ca/cbbrowne/sap.html
"Much of this software was user-friendly, meaning that it was intended
for users who did not know anything about computers, and furthermore
had absolutely no intention whatsoever of learning."
-- A. S. Tanenbaum, "Modern Operating Systems, ch 1.2.4"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2008-04-24 18:31:49 Re: I think this is a BUG?
Previous Message Alvaro Herrera 2008-04-24 18:25:40 Re: Adding notes against fields