pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Comment on Database and Admin Metadata
3+ messages / 3 participants
[nested] [flat]

* Comment on Database and Admin Metadata
@ 2003-05-14 16:22  Kuhn, Dylan K (4520500D) <Dylan.Kuhn@navy.mil>
  0 siblings, 2 replies; 3+ messages in thread

From: Kuhn, Dylan K (4520500D) @ 2003-05-14 16:22 UTC (permalink / raw)
  To: pgsql-admin; +Cc: tom@demayfamily.net

Greetings,

We are storing some metadata about a database in the database comment.  In short my question is, is there a better place?

We use a version-controlled model for our database design, and would like to know what model version any particular database implements.  A client can thereby determine by the model version if it is able to use the database.  

Bug #880 (http://archives.postgresql.org/pgsql-bugs/2003-01/msg00131.php) discusses some of the problems with comments on databases.  You have to know the current database name to create the comment, but you can't use current_database(), and you can't create a comment on any other database.  Also, you have to connect to the database to read the comment (which is not horrible, but not obvious either when looking at commands like '\l+').

This seems like it would be a common problem.  I'd like to know if there is a better place for such database-level metadata, and if there are plans to fix/change COMMENT ON DATABASE.  Or even if anyone else is deleting and adding records to pg_description like we are to accomplish this.

Thanks,
Dylan Kuhn

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Comment on Database and Admin Metadata
@ 2003-05-14 16:30  David F. Skoll <dfs@roaringpenguin.com>
  parent: Kuhn, Dylan K (4520500D) <Dylan.Kuhn@navy.mil>
  1 sibling, 0 replies; 3+ messages in thread

From: David F. Skoll @ 2003-05-14 16:30 UTC (permalink / raw)
  To: pgsql-admin

On Wed, 14 May 2003, Kuhn, Dylan K (4520500D) wrote:

> We use a version-controlled model for our database design, and would
> like to know what model version any particular database implements.  A
> client can thereby determine by the model version if it is able to use
> the database.

I use a special table called "schema" that holds a one-row entry with
the schema version number.  The upgrade scripts can extract the
existing schema and do any necessary adjustments to bring the schema
up-to-date.

It's not sophisticated, but it works.

--
David.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Comment on Database and Admin Metadata
@ 2003-05-14 16:46  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Kuhn, Dylan K (4520500D) <Dylan.Kuhn@navy.mil>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2003-05-14 16:46 UTC (permalink / raw)
  To: Kuhn, Dylan K (4520500D) <Dylan.Kuhn@navy.mil>; +Cc: pgsql-admin; tom@demayfamily.net

"Kuhn, Dylan K (4520500D)" <Dylan.Kuhn@navy.mil> writes:
> We are storing some metadata about a database in the database comment.  In =
> short my question is, is there a better place?

I'd suggest making a "control table" in each database that stores
whatever you need.  The database comment is only one field, but a
control table could be extended limitlessly.

> Bug #880 (http://archives.postgresql.org/pgsql-bugs/2003-01/msg00131.php) d=
> iscusses some of the problems with comments on databases.

AFAIK, no one has any plans to change the handling of comments.
Certainly it's not a very high-priority item.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-05-14 16:46 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-05-14 16:22 Comment on Database and Admin Metadata Kuhn, Dylan K (4520500D) <Dylan.Kuhn@navy.mil>
2003-05-14 16:30 ` David F. Skoll <dfs@roaringpenguin.com>
2003-05-14 16:46 ` Tom Lane <tgl@sss.pgh.pa.us>

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