Re: [SQL] Documenting a DB schema

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Shahaf Abileah <shahaf(at)redfin(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, pgsql-docs(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org, psql-novice(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Documenting a DB schema
Date: 2008-03-04 21:27:15
Message-ID: 47CDBEB3.3010106@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-docs pgsql-general pgsql-sql

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message libra dba 2008-03-04 22:07:50 using warm standby with drbd???
Previous Message Colin Wetherbee 2008-03-04 21:06:26 Re: Documenting a DB schema

Browse pgsql-docs by date

  From Date Subject
Next Message Mary Anderson 2008-03-04 22:13:02 Re: Documenting a DB schema
Previous Message Colin Wetherbee 2008-03-04 21:06:26 Re: Documenting a DB schema

Browse pgsql-general by date

  From Date Subject
Next Message libra dba 2008-03-04 22:07:50 using warm standby with drbd???
Previous Message Colin Wetherbee 2008-03-04 21:06:26 Re: Documenting a DB schema

Browse pgsql-sql by date

  From Date Subject
Next Message Mary Anderson 2008-03-04 22:13:02 Re: Documenting a DB schema
Previous Message Colin Wetherbee 2008-03-04 21:06:26 Re: Documenting a DB schema