Solved: SQL Query Problem

From: Kristian Lance <kristian(dot)lance(at)crc(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Solved: SQL Query Problem
Date: 2002-10-23 14:26:44
Message-ID: 5.1.0.14.2.20021023101733.00aeb2d8@mail.crc.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

This message is a follow up to this thread:

http://archives.postgresql.org/pgsql-bugs/2001-12/msg00008.php

I finally got a chance to rebuild the DB server using C locale, and it made
no difference to my ORDER BY problem. PostgreSQL did not distinguish
between slashes, dashes, and spaces when sorting the records.

Then, in a last-ditch attempt to try anything to get this working, I
recreated my table and changed the data type of my path column from varchar
to "bytea" (never used that one before) because I suspected that it would
sort using a binary string comparison instead of a language-oriented
one. It worked!!! Here's the output:

/usr/local/data/x/a
/usr/local/data/x/b
/usr/local/data/x/d
/usr/local/data/xc
/usr/local/data/xc/e

Thanks to Tom and Stephan for their feedback. However, the problem was not
related to the locale settings.

Kristian T. Lance
Database Application Developer (IS/Web)

Client Support Services
Information Networks and Systems

Communications Research Centre Canada
3701 Carling Avenue
Ottawa, Ontario
Canada K2H 8S2

Tel.: (613) 991-6812
Fax: (613) 991-5795

http://www.crc.ca

The Communications Research Centre Canada
is an agency of Industry Canada.

http://www.ic.gc.ca

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-10-23 15:27:26 Re: 10 concurrent clients / pure insert SQL scripts (each 100000 lines)
Previous Message Tom Lane 2002-10-23 14:13:18 Re: 'pg_dump --create' forgets database encoding