In GNUmed we have created a function

        gm_concat_table_structure()

in

        
http://cvs.savannah.gnu.org/viewcvs/gnumed/gnumed/server/sql/gmSchemaRevisionViews.sql?rev=1.6&root=gnumed&view=log

which returns a reproducable, human-readable TEXT
concatenation of all the relevant parts of the schema.

We then do

        select md5(gm_concat_table_structure());

and compare the output to known hashes for certain schema
versions. That way we don't simply "believe" what is in a
table "current_version" but rather actually *detect* (within
reasonable limits) the version.

It works well so far, no noticably delay even during client
startup (which does the check and complains on mismatches).
It may not scale particularly well to very large schemata,
possibly.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate

Reply via email to