James Gates <james.gates@sun.com> writes:
> I'm working with a issue where it seems the PostgreSQL server collation
> sequence for certain locales don't match the operating system's
> collation sequence for the same locale (set during initdb).
> I can reproduce this on both 8.1.9 & 8.2.5 on Solaris (both Nevada & 10).
FWIW, your example works as expected for me with 8.3 CVS tip on Fedora
Core 6:
postgres=# \encoding
LATIN1
postgres=# show lc_collate ;
lc_collate
----------------
sv_SE.iso88591
(1 row)
postgres=# select barf,ascii(barf) from jim order by barf asc;
barf | ascii
------+-------
a | 97
A | 65
� | 197
� | 228
� | 196
� | 214
(6 rows)
> In fact, I can't tell where this order is derived from?
In this context Postgres believes whatever strcoll() tells it. I don't
see any obvious hole in your methodology (except that I'm dubious about
the exhibited arguments for sort(1)) so it seems possible you've got a
bug in Solaris' strcoll(). But you should probably triple-check the
question of whether what's arriving at strcoll() is in the encoding it
expects.
regards, tom lane