Search Postgresql Archives

Re: md5() sorting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/7/07, Karsten Hilbert <Karsten.Hilbert@xxxxxxx> wrote:
> 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 ;-)

Maybe using digest(.., 'md5') function from pgcrypto would be better?
It gives bytea immidiately.

-- 
marko

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux