Re: Schema unique stamp (OID, MD5?)

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'jm(dot)poure(at)freesurf(dot)fr'" <jm(dot)poure(at)freesurf(dot)fr>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Schema unique stamp (OID, MD5?)
Date: 2002-02-24 20:14:13
Message-ID: FED2B709E3270E4B903EB0175A49BCB10475F0@dogbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm(dot)poure(at)freesurf(dot)fr]
> Sent: 24 February 2002 15:40
> To: Dave Page; pgadmin-hackers(at)postgresql(dot)org
> Subject: Re: [pgadmin-hackers] Schema unique stamp (OID, MD5?)
>
>
> Dear Dave,
>
> MD5 is a way to create a unique signature of files. For
> example, it is used
> to create unique signatures or RPMs or ISO files.

Yes, I know.

> MD5 could well be used to create a unique signature of the
> database schema:
>
> In bash :
> md5sum < pg_dump --schema-only database_name.
>
> result (example):
> 9b05A8d545...

Yes.

> md5stamp ("database", db_name) : would update the signature of schema
> server-side. The signature would be stored along in
> pg_database in a "stamp"
> field.

As I said in my ealier email on the subject, this would probably be
expensive to do often enough to be useful. This was run using the PostgreSQL
7.2 regression test database, running on Cygwin/Windows XP on a 512Mb,
850MHz Dell Inspiron 8000 laptop:

PC20 $ time pg_dump -s regression > regression.sql

real 0m14.210s
user 0m0.620s
sys 0m1.201s

A second run (because things may be cached now yields:

PC20 $ time pg_dump -s regression > regression.sql

real 0m6.914s
user 0m0.600s
sys 0m1.161s

And there will be extra expense in calculating the checksum.

> Then, in case of multi-user development, pgAdmin2 could be
> aware of a change
> in schema, simply looking at db name "stamp". Maybe there is
> an easier way to
> proceed...

Yes, as I suggested, check the ctid of the relevant tuple. If it has
changed, the the object the tuple represents has been updated, if you can't
find it, it's been deleted.

Regards, Dave.

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2002-02-24 20:19:24 Re: Working oin pgAdmin2
Previous Message Dave Page 2002-02-24 20:05:17 Re: Escaping quotes and double-quotes problem