Re: Documenting a DB schema - Mailing list pgsql-general

From Colin Wetherbee
Subject Re: Documenting a DB schema
Date
Msg-id 47CDB9D2.5070106@denterprises.org
Whole thread Raw
In response to Documenting a DB schema  ("Shahaf Abileah" <shahaf@redfin.com>)
List pgsql-general
Shahaf Abileah wrote:
> It would be great if the documentation could be kept as close to the
> code as possible – that way we stand a chance of keeping it up to date.
> So, in the same way that Java docs go right there on top of the class or
> method definitions, it would be great if I could attach my comments to
> the table definitions. It looks like MySQL has that kind of capability:

Please do not cross-post.  One list is enough.

PostgreSQL has that functionality, too.

cww=# CREATE TABLE foo (a INTEGER, b INTEGER);
CREATE TABLE
cww=# COMMENT ON TABLE foo IS 'my comment';
COMMENT
cww=# \d+
               List of relations
  Schema | Name | Type  | Owner | Description
--------+------+-------+-------+-------------
  public | foo  | table | cww   | my comment
(1 row)

COMMENT is well-documented.

http://www.postgresql.org/docs/8.3/static/sql-comment.html

Colin

pgsql-general by date:

Previous
From: Alan Hodgson
Date:
Subject: Re: Documenting a DB schema
Next
From: Tomás Di Doménico
Date:
Subject: Re: Documenting a DB schema