title: Unicode character default collation table
body: <p>I don't know which site this question belongs exactly, so posting it here.</p>
  
  <p>I use Postgresql 9.2 on RHEL 6.4 and observe the following:</p>
  
  <pre><code>select foo 
  from unnest('{а,ә,б,в,г,д,е,ж}'::text[]) as foo 
  order by foo collate "kk_KZ.utf8"
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>а
  ә
  б
  в
  г
  д
  е
  ж
  </code></pre>
  
  <p>BUT</p>
  
  <pre><code>select foo 
  from unnest('{а,ә,б,в,г,д,е,ж}'::text[]) as foo 
  order by foo collate "en_US.utf8"
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>а
  б
  в
  г
  д
  е
  ә -- misplaced
  ж
  </code></pre>
  
  <p>Further, I found that there is the Default Unicode Collation Element Table [1], which lists the character in question (04D9  ; [.199D.0020.0002.04D9] # CYRILLIC SMALL LETTER SCHWA) in proper order.</p>
  
  <p>I understand that it is silly to expect the cyrillic characters be handled properly by "en_US.utf8" locale, but what is the correct behavior by Unicode or any other relevant standards in cases, where a character does not normally belong to language/locale used for collation?</p>
  
  <p>[1] <a href="http://www.unicode.org/Public/UCA/latest/allkeys.txt" rel="nofollow">http://www.unicode.org/Public/UCA/latest/allkeys.txt</a></p>