This is a multi-part message in MIME format.
--------------020004090401080306070400
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Shahaf Abileah wrote:
>
> I'm looking for a systematic way to do***ent 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 do***entation 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 sup****t 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
--------------020004090401080306070400
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Shahaf Abileah wrote:
<blockquote
cite="mid:082D8A131DF72A4D88C908A1AD3DEB22023B34F2@[EMAIL PROTECTED]
"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place">
<o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PostalCode"><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="State">
<o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street">
<o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="address"><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@[EMAIL PROTECTED]
"Trebuchet MS";
panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
p.trebuchet, li.trebuchet, div.trebuchet
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
@[EMAIL PROTECTED]
Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style></o:SmartTagType></o:SmartTagType></o:SmartTagType></o:SmartTagType></o:SmartTagType></o:SmartTagType>
<div class="Section1">
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">I’m looking for a
systematic way to do***ent the
schema for the database behind our website (<a moz-do-not-send="true"
href="http://www.redfin.com/"
title="http://www.redfin.com/">www.redfin.com</a>),
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?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">It would be great if the
do***entation 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:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family:
Arial;">
create table table_with_comments(a int comment 'this is column
a...');<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">(see <a
moz-do-not-send="true"
href="http://dev.mysql.com/doc/refman/5.0/en/create-table.html"
title="http://dev.mysql.com/doc/refman/5.0/en/create-table.html">http://dev.mysql.com/doc/refman/5.0/en/create-table.html</a>)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">However, Postgres
doesn’t
sup****t the
“comment” keyword. Is there an
alternative?<o:p></o:p></span></font></p>
</div>
</blockquote>
<font size="2"><font face="Arial">You mean like:<br>
COMMENT ON mytable IS 'This is my table. Mine, mine, mine';<br>
<br>
You can also comment columns, databases, functions, schemas, domains,
etc.<br>
<br>
Cheers,<br>
Steve<br>
<br>
</font></font>
</body>
</html>
--------------020004090401080306070400--


|