On Wed, Jan 28, 2004 at 09:32:56AM -0500, Daniel Gaudreault wrote:
> One of our developers came across the fact that postgres is ignoring
> spaces when sorting results from a query. We are using PGSQL 7.3.4 on
> the backend. Is there something that needs to be set somewhere to for
> the sort to not ignore spaces?
This is locale related; Postgres just uses strcoll. You could try
changing your locale, but it's difficult to do on an existing database.
I think the C locale orders by byte values, but most single-byte locales
have funny rules regarding whitespace.
A workaround could be ask the server to sort not using the column
itself, but a function of it that replaces the spaces with something
else that has the desired sorting effect.
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"¿Cómo puedes confiar en algo que pagas y que no ves,
y no confiar en algo que te dan y te lo muestran?" (Germán Poo)
In response to
pgsql-general by date
|Next:||From: Tom Lane||Date: 2004-01-31 23:10:16|
|Subject: Re: Sorting is ignoring spaces |
|Previous:||From: Alvaro Herrera||Date: 2004-01-31 22:43:22|
|Subject: Re: Insert question null/not null serial, etc.|