From: | Stef <svb(at)ucs(dot)co(dot)za> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org |
Subject: | Table versions |
Date: | 2003-10-29 10:57:52 |
Message-ID: | 20031029125752.35069e3b.svb@ucs.co.za |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin pgsql-sql |
Hi all,
I'm trying to create some kind of table version control
system for approximately 300 postgres databases
ranging in version from 7.1.2 to 7.3.4.
I compared the "pg_dump -s" output between
the various versions of databases, but the format is inconsistent,
and I can't do diff's to check that table structures are identical
on the various databases this way.
What I did next, is put a trigger on pg_attribute that should, in theory,
on insert and update, fire up a function that will increment a version
number on a table comment every time a table's structure is modified.
I tried to make the function update a comment on pg_description to
accomplish this.
I'm having a lot of trouble doing this and testing it, and after plenty tries
it's still not working. I've attached the trigger statement and the plpgsql function.
(There might be a few mistakes, and I haven't attempted to cater for
system columns and multiple changes yet.)
Can somebody please tell me if what I'm trying will ever work, or
maybe an alternative (easier) way to compare a specific table's
structure amongst various databases, that are not necessarily
on the same network, nor of the same version of postgres.
Regards
Stefan
Attachment | Content-Type | Size |
---|---|---|
test.plpgsql | application/octet-stream | 386 bytes |
test.trigger | application/octet-stream | 137 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Stef | 2003-10-29 11:21:33 | Re: [SQL] Table versions |
Previous Message | scott.marlowe | 2003-10-28 23:53:28 | Re: Authentication Question |
From | Date | Subject | |
---|---|---|---|
Next Message | Stef | 2003-10-29 11:21:33 | Re: [SQL] Table versions |
Previous Message | Clint Stotesbery | 2003-10-29 04:06:08 | create type input and output function examples |