dbTalk Databases Forums  

Re: How to make a good documentation of a database ?

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Re: How to make a good documentation of a database ? in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Pradier
 
Posts: n/a

Default Re: How to make a good documentation of a database ? - 11-18-2004 , 09:57 AM






Well, yes, that's what I currently use.
The dot output is very interesting, but I guess the complete database
image will be 16 meters x 16 meters large when I have finished adding
the constraints.
I have already stopped to print it.
That's why I'd like to make something more 'paper-y' like 'The book of
my database', with lots of comments.

Or, I could insert the comments in the database itself so that autodoc
auto-documents them :-)
In fact, I have already looked a little into the tables of PostgreSQL itself
to see if I could hack it by adding a column "Comments" in the "table of
columns".
But I guess it isn't wise nor feasible, is it ?

On Thu, Nov 18, 2004 at 09:10:19AM -0600, Timothy Perrigo wrote:
Quote:
Autodoc might be useful: http://www.rbt.ca/autodoc/


On Nov 18, 2004, at 8:31 AM, David Pradier wrote:

Hi !

I've just inherited the responsibility of a postgresql database
of roughly 480 tables and 6460 columns, mainly without constraints,
not even foreign keys.

I'd like to make it a little more orthodox (lots and lots of
constraints, yeah !!), but I need a tool to make a documentation about
every column, at least, as some column are really vicious (like, they
are a foreign key to a table which depends on the type of another
column...).

The best idea I could come with to do that was to maintain an output of
pgdump --shema-only, versioned with cvs, annotated with a patch, itself
versioned with cvs.
Not that bright, isn't it ?

The problem is, I don't want to use a lot of time to maintain this
documentation, and above all, I'd prefer not to insert the information
twice (read: a new constraint in the database should automagically
update the documentation).

Does somebody know the right way to do this ?

Best regards,
David Pradier

--
dpradier (AT) apartia (DOT) fr - tel: 01.46.47.21.33 - fax: 01.45.20.17.98

---------------------------(end of
broadcast)---------------------------
TIP 8: explain analyze is your friend



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
--
dpradier (AT) apartia (DOT) fr - tel: 01.46.47.21.33 - fax: 01.45.20.17.98

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
  #2  
Old   
George Essig
 
Posts: n/a

Default Re: How to make a good documentation of a database ? - 11-18-2004 , 11:58 AM






David Pradier wrote:
Quote:
The problem is, I don't want to use a lot of time to maintain this
documentation, and above all, I'd prefer not to insert the information
twice (read: a new constraint in the database should automagically
update the documentation).
You could use the postgresql's comment statement together with postgresql_autodoc. See the
following links for documentation and examples:

http://www.postgresql.org/docs/7.4/i...l-comment.html
http://www.rbt.ca/autodoc/
http://www.rbt.ca/autodoc/output.html
http://www.rbt.ca/autodoc/autodocexample.html
http://www.rbt.ca/autodoc/output-graphviz.html

George Essig

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
  #3  
Old   
Nageshwar Rao
 
Posts: n/a

Default Re: How to make a good documentation of a database ? - 11-19-2004 , 01:47 AM



Hi,
I have set of create table statements. I need to execute them at one go
instead of running individual statement to create a table.
Help !
Thx


-----Original Message-----
From: Timothy Perrigo [mailto:tperrigo (AT) wernervas (DOT) com]
Sent: Thursday, November 18, 2004 8:40 PM
To: pgsql-general (AT) postgresql (DOT) org
Subject: Re: [GENERAL] How to make a good documentation of a database ?

Autodoc might be useful: http://www.rbt.ca/autodoc/


On Nov 18, 2004, at 8:31 AM, David Pradier wrote:

Quote:
Hi !

I've just inherited the responsibility of a postgresql database
of roughly 480 tables and 6460 columns, mainly without constraints,
not even foreign keys.

I'd like to make it a little more orthodox (lots and lots of
constraints, yeah !!), but I need a tool to make a documentation about
every column, at least, as some column are really vicious (like, they
are a foreign key to a table which depends on the type of another
column...).

The best idea I could come with to do that was to maintain an output of
pgdump --shema-only, versioned with cvs, annotated with a patch, itself
versioned with cvs.
Not that bright, isn't it ?

The problem is, I don't want to use a lot of time to maintain this
documentation, and above all, I'd prefer not to insert the information
twice (read: a new constraint in the database should automagically
update the documentation).

Does somebody know the right way to do this ?

Best regards,
David Pradier

--
dpradier (AT) apartia (DOT) fr - tel: 01.46.47.21.33 - fax: 01.45.20.17.98

---------------------------(end of
broadcast)---------------------------
TIP 8: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)



Reply With Quote
  #4  
Old   
David Pradier
 
Posts: n/a

Default Re: How to make a good documentation of a database ? - 11-19-2004 , 03:04 AM



Thanks to everybody, Matt, Timothy, Richard, Csaba, Chris and George for
your help :-)

Finally, I think the right way to go for me is to generate an html
output with postgresql-autodoc and make it accessible to every
developer.

Thanks a lot for your help !

--
dpradier (AT) apartia (DOT) fr - tel: 01.46.47.21.33 - fax: 01.45.20.17.98

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
  #5  
Old   
Richard Huxton
 
Posts: n/a

Default Batching multiple CREATE TABLE commands - 11-19-2004 , 03:34 AM



Nageshwar Rao wrote:
Quote:
Hi,
I have set of create table statements. I need to execute them at one go
instead of running individual statement to create a table.
Help !
Nageshwar - two tips for posting to the mailing lists
1. Don't reply to an existing message with a new question
2. Make sure the subject line describes your question.
Otherwise, many people won't notice your question and you'll get less
people able to help.

As to the best way of executing multiple CREATE TABLE statements, that
depends on whether you are using psql or some other client. With psql
I'd put the statements in a file, then use something like:
psql -f my_commands.sql
psql < my_commands.sql
Or, if you're logged into psql you could use:
\i my_commands.sql
All covered in the man page for psql.

I always wrap the whole lot in BEGIN ... COMMIT so that if (usually
when) I make a mistake it rolls back all the changes.

HTH
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.