> I'm just looking for the correct workaround. While adding a new collation is the "correct" solution it's a lot of work. Even then pg can't use different collations anyway unless you reinit the datadir using initdb. One workaround is to cast the text value into a bytea value, and then it will be sorted in byte order no matter what locale you have. Like this: SELECT * FROM foo ORDER BY CAST (some_column AS BYTEA); This work except that there is no cast from text to bytea. But we can add one using: CREATE CAST (text AS bytea) WITHOUT FUNCTION AS ASSIGNMENT; I can't promise that WITHOUT FUNCTION will always work but currently bytea and text values are stored in the same way so it should work (and it probably will in future versions as well). /Dennis ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings