Merhabalar,
PostgreSQL 14 kurulumu sonrası colation olarak “tr_TR.UTF-8” seçmek isterseniz, aşağıdaki gibi “postgresql invalid locale name” hatası alabilirsiniz.
postgres=# CREATE DATABASE forenda
postgres-# WITH TEMPLATE = template0
postgres-# ENCODING = 'UTF8'
postgres-# LC_COLLATE = 'tr_TR.UTF-8'
postgres-# LC_CTYPE = 'tr_TR.UTF-8'
postgres-# CONNECTION LIMIT = -1;
ERROR: invalid locale name: "tr_TR.UTF-8"
Bu sorunun çözümü için gerekli dil paketini sisteminize yüklemeniz gerekir. Ubuntu/Debian ve Redhat/CentOS işletim sistemleri için aşağıdaki çözüm yolunu uygulayabilirsiniz.
root@proddb1:~# locale -a
C
C.utf8
en_US.utf8
POSIX
root@proddb1:~# locale-gen tr_TR
Generating locales (this might take a while)...
tr_TR.ISO-8859-9... done
Generation complete.
root@proddb1:~# locale-gen tr_TR.UTF-8
Generating locales (this might take a while)...
tr_TR.UTF-8... done
Generation complete.
root@proddb1:~# locale -a
C
C.utf8
en_US.utf8
POSIX
tr_TR
tr_TR.iso88599
tr_TR.utf8
turkish
systemctl restart postgresql
CREATE DATABASE forenda
WITH TEMPLATE = template0
ENCODING = 'UTF8'
LC_COLLATE = 'tr_TR.UTF-8'
LC_CTYPE = 'tr_TR.UTF-8'
CONNECTION LIMIT = -1;
rpm -ivh glibc-all-langpacks-2.28-164.el8.x86_64.rpm
systemctl restart postgresql
CREATE DATABASE forenda
WITH TEMPLATE = template0
ENCODING = 'UTF8'
LC_COLLATE = 'tr_TR.UTF-8'
LC_CTYPE = 'tr_TR.UTF-8'
CONNECTION LIMIT = -1;
Kolay gelsin.