pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Colin Wetherbee <cww@denterprises.org>
To: Shahaf Abileah <shahaf@redfin.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Documenting a DB schema
Date: Tue, 04 Mar 2008 16:06:26 -0500
Message-ID: <47CDB9D2.5070106@denterprises.org> (raw)
In-Reply-To: <082D8A131DF72A4D88C908A1AD3DEB22023B34F2@mail-1.rf.lan>
References: <082D8A131DF72A4D88C908A1AD3DEB22023B34F2@mail-1.rf.lan>

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



view thread (11+ messages)  latest in thread

Message-ID: <47CDB9D2.5070106@denterprises.org>
Permalink:  ../47CDB9D2.5070106@denterprises.org/
Also on:    postgresql.org/message-id/47CDB9D2.5070106@denterprises.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: cww@denterprises.org, shahaf@redfin.com, pgsql-general@postgresql.org
  Subject: Re: Documenting a DB schema
  In-Reply-To: <47CDB9D2.5070106@denterprises.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox