Re: md5() sorting

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: md5() sorting
Date: 2007-11-07 15:45:54
Message-ID: 20071107154554.GF5804@merkur.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 07, 2007 at 05:36:47PM +0200, Marko Kreen wrote:

> > > I'm wondering if you cast the md5sum as a bytea instead of text and
> > > then sort, if that would solve it simply.
> >
> > Along the lines of
> >
> > ... ORDER BY decode(md5('...'), 'hex');
> >
> Maybe using digest(.., 'md5') function from pgcrypto would be better?
> It gives bytea immidiately.

Sounds better at first, yes, but requires pgcrypto to be
installed on machines onto which GNUmed is to be deployed.

Thanks for the suggestion, though.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-07 15:51:13 Re: The .pgpass file
Previous Message Gauthier, Dave 2007-11-07 15:40:04 Re: Temporary, In-memory Postgres DB?