I have created a database with Turkish collation.
createdb -l tr_TR test_tr -E LATIN5 -T template0
Then a table with a row.
\c test_tr
create table turkish(one text);
insert into turkish values('inci');
Everything is expected.
test_tr=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
------------+----------+----------+-------------+-------------+-----------------------
test_tr | postgres | LATIN5 | tr_TR | tr_TR |
The problem, I expect İNCİ but it gives me INCI. This is wrong for Turkish language.
test_tr=# select upper("one") from turkish ;
upper
-------
INCI
(1 row)
It turns out, the default collation is still English.
test_tr=# select upper("one" collate "tr_TR"),upper("one"), "one" from turkish ;
upper | upper | one
-------+-------+------
İNCİ | INCI | inci
I know that this could be fixed via giving tr_TR collation while table creation like following:
create table turkish (one text collate "tr_TR");
So the question:
Is there any way to set default collation that Postgresql uses for table creation? That way, I can omit unnecessary collation specification on every table creation script.