Change in behaviour of ORDER BY clause in PG7.3

Started by Ollie Clarkabout 22 years ago3 messages
#1Ollie Clark
oliverc@comp.leeds.ac.uk

Since upgrading to 7.3 I've noticed that the ORDER BY clause seems to
ignore leading spaces/punctuation for eg we have a simple table with 6
rows containing:

'a'
'b'
'c'
'd'
' bill'
'-bill'

SELECT * FROM table ORDER BY 1;

gives:

a
b
bill
-bill
c
d

which is different from previous versions and different to MySQL and SQL
Server. Is this a bug, or can you turn this behaviour off? It's breaking a
lot of our applications!

--
Ollie Clark - oliverc@comp.leeds.ac.uk - ol@ollieclark.com
http://www.ollieclark.com/acronyms.html

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Ollie Clark (#1)
Re: Change in behaviour of ORDER BY clause in PG7.3

Ollie Clark writes:

Since upgrading to 7.3 I've noticed that the ORDER BY clause seems to
ignore leading spaces/punctuation for eg we have a simple table with 6
rows containing:

You need to set the right locale. You appear to expect the "C" locale, so
you need to tell initdb about it.

--
Peter Eisentraut peter_e@gmx.net

In reply to: Ollie Clark (#1)
Re: Change in behaviour of ORDER BY clause in PG7.3

"Ollie Clark <oliverc@comp.leeds.ac.uk>" wrote in
comp.databases.postgresql.hackers:

[sNip]

which is different from previous versions and different to MySQL and SQL
Server. Is this a bug, or can you turn this behaviour off? It's breaking
a lot of our applications!

Could you clarify which vendor's SQL Server you're referring to? Or do
you mean a subset of MySQL or PostgreSQL?

--
Sir Randolf, noble spam fighter - rr@8x.ca
Vancouver, British Columbia, Canada

Please do not eMail me directly when responding
to my postings in the newsgroups.