Storing a file hash as primary key

From: Eduardo Pérez Ureta <eperez(at)it(dot)uc3m(dot)es>
To: pgsql-general(at)postgresql(dot)org
Subject: Storing a file hash as primary key
Date: 2004-05-07 17:25:54
Message-ID: 20040507172554.GA10923@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was wondering what the best way is to store a file hash (MD5 or SHA1)
and make it primary key indexed.
I have seen some people storing the hexadecimal encoded MD5 in a
CHAR(32) but it may be a better idea to use a CHAR(16) without encoding
the string, but that may cause some problems.

What do you recommend?
Do you have any experiences storing file hashes in a database?
Do you know any good opensource software that stores file hashes in the
database (to take a look)?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2004-05-07 17:36:22 Re: any experience with multithreaded pg apps?
Previous Message Tom Lane 2004-05-07 17:25:14 Re: Interpreting vacuum verbosity