I’m trying to sort by converted column, but psql returns error:
SELECT * FROM table ORDER BY CONVERT(col1 USING
utf8_to_iso_8859_2);ERROR: syntax error at or near “USING” LINE 1: SELECT * FROM
table ORDER BY CONVERT(col1 USING utf8…
^*** Error ***
ERROR: syntax error at or near “USING” SQL state: 42601
I saw this function used liked this before and it’s in documentation too, so I don’t understand why I’m getting this error. Anything I missed?
It looks like you are mixing two features. One is collation support, that would make sense in an
ORDER BYclause:The other one is the
convert()function that transcodes a string from a source encoding to a defined destination encoding:But that has no effect on the sort order – except with locale
Cor abyteacolumn.