Thai and English in a postgresql
On PostgreSQL 9.1 and newer, you can use the COLLATE qualifier on an operation to override the database's default collation. See the manual for information on collation support.

E.g.

SELECT a, b FROM mytable ORDER BY c COLLATE 'th_TH.UTF-8';


Note that PostgreSQL can't mix different collations, using a dynamic collation based on detected language. It doesn't work like that.

On prior versions you must use a single database-wide collation. So you'd have to dump your database, CREATE DATABASE ... ENCODING 'UTF-8' LC_COLLATE 'th_TH.UTF-8', and re-load.