Thread: Checksum/Hash Functions
Does PostgreSQL have any built-in check sum or hash functions. I want to be able to compute a checksum of a string as I display a record to the user and when the user updates the record compare the checksum in the update statement. I can do the checksum on the client side but it would save the overhead of an additional select statement at update time if the checksum could be computed on the database backend. I know I could write my own function to do this but I first wanted to check if there was a function already setup to do it. I have looked at the documentation but did not find anything. --------- Bryan White This email represents the consensus opinion of the many voices in my head.
Look in contrib/crypto (I think it was crypto). There are some hash functions and other crpto stuffs in there. Joshua b. Jore ; http://www.greentechnologist.org ; 1121 1233 1311 200 1201 1302 1211 200 1201 1303 200 1300 1233 1313 1211 1302 1212 1311 1230 200 1201 1303 200 1321 1233 1311 1302 200 1211 1232 1211 1231 1321 200 1310 1220 1221 1232 1223 1303 200 1321 1233 1311 200 1201 1302 1211 232 200 1112 1233 1310 1211 200 1013 1302 1211 1211 1232 201 22 On Thu, 30 May 2002, Bryan White wrote: > Does PostgreSQL have any built-in check sum or hash functions. > > I want to be able to compute a checksum of a string as I display a record to > the user and when the user updates the record compare the checksum in the > update statement. I can do the checksum on the client side but it would > save the overhead of an additional select statement at update time if the > checksum could be computed on the database backend. > > I know I could write my own function to do this but I first wanted to check > if there was a function already setup to do it. I have looked at the > documentation but did not find anything. > > --------- > Bryan White > This email represents the consensus opinion > of the many voices in my head. > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >
There are some hashes in the contrib/pg_crypto addition. You may need to install this specifically (it's a separate RPM, or, if you install from source, it's in the contrib/ folder). - J. Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Knowledge Management & Technology Consultant > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Bryan White > Sent: Thursday, May 30, 2002 9:53 AM > To: pgsql-general > Subject: [GENERAL] Checksum/Hash Functions > > > Does PostgreSQL have any built-in check sum or hash functions. > > I want to be able to compute a checksum of a string as I display > a record to > the user and when the user updates the record compare the checksum in the > update statement. I can do the checksum on the client side but it would > save the overhead of an additional select statement at update time if the > checksum could be computed on the database backend. > > I know I could write my own function to do this but I first > wanted to check > if there was a function already setup to do it. I have looked at the > documentation but did not find anything. > > --------- > Bryan White > This email represents the consensus opinion > of the many voices in my head. > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >