Accent sensitive sort in PostgreSQL
How to sort text in PostgreSQL in Latvian alphabetic order, so any letter without accent always comes before the letter with accent? For example this select * from ( select 'bā' as name union select 'āa' union select 'ac' union…