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:27:54
Message-ID: 20071107152754.GE5804@merkur.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 07, 2007 at 03:54:02PM +0100, Martijn van Oosterhout wrote:

> > Should I be going about this sorting or hashing or detection
> > business in another way entirely which can be done at the
> > SQL level ?
>
> 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');

? I knew I'd ask here ;-)

BTW, my Google Fu was lacking or I'd have found this earlier:

http://www.varlena.com/GeneralBits/21.php
(see middle of page)

Thanks,
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 Marko Kreen 2007-11-07 15:36:47 Re: md5() sorting
Previous Message Tom Lane 2007-11-07 15:23:06 Re: any way for ORDER BY x to imply NULLS FIRST in 8.3?