pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ruggero.maria.rossi@libero.it
To: pgsql-sql@postgresql.org
Subject: Sorting problem
Date: 12 Jul 2004 01:27:53 -0700
Message-ID: <3610e3e1.0407120027.2e04f948@posting.google.com> (raw)

Hi all,
I have a problem sorting varchar fields.
I will explain the problem with a simple example:

this query
   select '##10' as sortfield
   union
   select '###1' as sortfield
   order by sortfield
produces this correct output:
   '###1'
   '##10'

but this one

  select '##10############--------####79909999' as sortfield
  union
  select '###1############--------####79909999' as sortfield
  order by sortfield
produces this wrong output:
   '##10############--------####79909999'
   '###1############--------####79909999'

I'm using postgresql 7.4.3 on Suse Linux 9.1.
I created my db using: initdb --pgdata=../data/ --encoding=LATIN1
--lc-collate=it_IT --lc-ctype=it_IT

Any suggestion?
Tia
Ruggero



view thread (8+ messages)  latest in thread

Message-ID: <3610e3e1.0407120027.2e04f948@posting.google.com>
Permalink:  ../3610e3e1.0407120027.2e04f948@posting.google.com/
Also on:    postgresql.org/message-id/3610e3e1.0407120027.2e04f948@posting.google.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ruggero.maria.rossi@libero.it
  Subject: Re: Sorting problem
  In-Reply-To: <3610e3e1.0407120027.2e04f948@posting.google.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox