Re: digest data types?

From: Neil Conway <neilc(at)samurai(dot)com>
To: Reece Hart <reece(at)harts(dot)net>
Cc: SF PostgreSQL <sfpug(at)postgresql(dot)org>
Subject: Re: digest data types?
Date: 2007-04-12 22:56:00
Message-ID: 1176418560.6382.13.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug

On Thu, 2007-04-12 at 15:40 -0700, Reece Hart wrote:
> Does anyone have postgresql types for message digests, especially md5
> and sha1?

I don't know of one offhand, but such a type would be pretty easy to
write.

Without using a custom data type, you can at least store the digest in
base64, or even better use bytea (although neither would be quite as
efficient as using a custom UDT).

> Am I correct in assuming that the space saved by storing digests as
> binary (1/2 size of hex) will substantially impact index ins/upd/del
> performance or when the digest itself is a large fraction of the rest of
> the row size?

In most cases, I don't think this would have a significant performance
impact.

-Neil

In response to

Responses

Browse sfpug by date

  From Date Subject
Next Message Reece Hart 2007-04-12 23:34:35 Re: digest data types?
Previous Message Reece Hart 2007-04-12 22:40:48 digest data types?