Re: Documenting a DB schema

From: Colin Wetherbee <cww(at)denterprises(dot)org>
To: Shahaf Abileah <shahaf(at)redfin(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Documenting a DB schema
Date: 2008-03-04 21:06:26
Message-ID: 47CDB9D2.5070106@denterprises.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-docs pgsql-general pgsql-sql

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Steve Crawford 2008-03-04 21:27:15 Re: [SQL] Documenting a DB schema
Previous Message Alan Hodgson 2008-03-04 21:00:50 Re: Documenting a DB schema

Browse pgsql-docs by date

  From Date Subject
Next Message Steve Crawford 2008-03-04 21:27:15 Re: [SQL] Documenting a DB schema
Previous Message Alan Hodgson 2008-03-04 21:00:50 Re: Documenting a DB schema

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2008-03-04 21:27:15 Re: [SQL] Documenting a DB schema
Previous Message Alan Hodgson 2008-03-04 21:00:50 Re: Documenting a DB schema

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Crawford 2008-03-04 21:27:15 Re: [SQL] Documenting a DB schema
Previous Message Alan Hodgson 2008-03-04 21:00:50 Re: Documenting a DB schema