Re: storing binary data - Mailing list pgsql-general

From Tom Lane
Subject Re: storing binary data
Date
Msg-id 29152.971755056@sss.pgh.pa.us
Whole thread Raw
In response to Re: storing binary data  (Neil Conway <nconway@klamath.dyndns.org>)
Responses Re: storing binary data  (Neil Conway <nconway@klamath.dyndns.org>)
List pgsql-general
Neil Conway <nconway@klamath.dyndns.org> writes:
>> You could use bytea, but I would recommend converting the checksum
>> to a hex digit string and then storing that in a char-type field.
>> Hex is the usual textual representation for MD5 values, no?

> It is, but (IMHO) it's a big waste of space. The actual MD5 digest is
> 128 bits. If stored in binary form, it's 16 bytes. If stored in hex
> form (as ASCII), it's 32 characters @ 1 byte per character =3D 32 bytes.

You're worried about 16 bytes per pg_shadow entry?  Get real.  I'd
have recommended bytea if the amount of storage involved were actually
significant, but for this application readability seems more important.

            regards, tom lane

pgsql-general by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: storing binary data
Next
From: Bruce Momjian
Date:
Subject: Re: web programming