pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Crawford <scrawford@pinpointresearch.com>
To: Shahaf Abileah <shahaf@redfin.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-docs@postgresql.org
Cc: pgsql-general@postgresql.org
Cc: psql-novice@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Documenting a DB schema
Date: Tue, 04 Mar 2008 13:27:15 -0800
Message-ID: <47CDBEB3.3010106@pinpointresearch.com> (raw)
In-Reply-To: <082D8A131DF72A4D88C908A1AD3DEB22023B34F2@mail-1.rf.lan>
References: <082D8A131DF72A4D88C908A1AD3DEB22023B34F2@mail-1.rf.lan>

Shahaf Abileah wrote:
>
> I'm looking for a systematic way to document the schema for the 
> database behind our website (www.redfin.com <http://www.redfin.com/;), 
> so that the developers using this database have a better idea what all 
> the tables and columns mean and what data to expect.  Any recommendations?
>
>  
>
> 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:
>
>  
>
>             create table table_with_comments(a int comment 'this is 
> column a...');
>
>  
>
> (see http://dev.mysql.com/doc/refman/5.0/en/create-table.html)
>
>  
>
> However, Postgres doesn't support the "comment" keyword.  Is there an 
> alternative?
>
You mean like:
COMMENT ON mytable IS 'This is my table. Mine, mine, mine';

You can also comment columns, databases, functions, schemas, domains, etc.

Cheers,
Steve

view thread (11+ messages)  latest in thread

Message-ID: <47CDBEB3.3010106@pinpointresearch.com>
Permalink:  ../47CDBEB3.3010106@pinpointresearch.com/
Also on:    postgresql.org/message-id/47CDBEB3.3010106@pinpointresearch.com

 · 

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: scrawford@pinpointresearch.com, shahaf@redfin.com, pgsql-admin@postgresql.org, pgsql-docs@postgresql.org, pgsql-general@postgresql.org, psql-novice@postgresql.org
  Subject: Re: [SQL] Documenting a DB schema
  In-Reply-To: <47CDBEB3.3010106@pinpointresearch.com>

* 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