Re: Adding notes against fields - Mailing list pgsql-general

From Chris Browne
Subject Re: Adding notes against fields
Date
Msg-id 60tzhr6rb3.fsf@dba2.int.libertyrms.com
Whole thread Raw
In response to Adding notes against fields  (Oliver Helm <oliver@blue-emu.net>)
List pgsql-general
oliver@blue-emu.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
toby 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 infact possible, and point me in the right 
> direction?

Have you taken a look at the COMMENT statement?

test@[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"

pgsql-general by date:

Previous
From: Howard Cole
Date:
Subject: Multiple Database Strategy
Next
From: "Matthew T. O'Connor"
Date:
Subject: Re: How to modify ENUM datatypes?