Re: lexicographical ordering in postgres

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Paramveer(dot)Singh(at)trilogy(dot)com
Cc: pgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: lexicographical ordering in postgres
Date: 2004-09-16 10:07:30
Message-ID: 20040916100728.GA18480@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Check your locale settings. The en_US locale sorts like that for
example...

On Thu, Sep 16, 2004 at 04:00:43AM -0500, Paramveer(dot)Singh(at)trilogy(dot)com wrote:
> Hi!
> I created a table in postgres with varchar values in it, and I noticed that
> postgres lexicographical ordering is weird in the sense that it ignores
> whitespaces.
> please look at the result I got:
>
> select * from tablename order by columnname;
> cloumnname
> -------------------------------------
> one 1
> one 1
> one 12
> one 2
> one 30
> (5 rows)
> This means that 'one<space>1' and 'one<space><space>1' are the same
> lexicographically.
> Is this correct?
> thanks
> paraM
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Najib Abi Fadel 2004-09-16 10:08:23 Re: pg_dump in cycle
Previous Message m.b. 2004-09-16 09:57:36 Stemmer integration in tsearch2 / $libdir error