Re: Default locale in postgres

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Tom for replying.


support@vrni-platform-release:~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

My locale settings are like above. But I am seeing is C picked by postgres. Any idea why it is picking C instead of en_US.UTF-8. I am on Ubuntu 14 and postgres 9.5.4. In initdb I am just passing encoding as UTF-8 and data checksum as enabled.

support@vrni-platform-release:~$ psql -l -U postgres -h localhost
                             List of databases
   Name    |  Owner   | Encoding | Collate | Ctype |   Access privileges
-----------+----------+----------+---------+-------+-----------------------
 postgres  | postgres | UTF8     | C       | C     |
 template0 | postgres | UTF8     | C       | C     | =c/postgres          +
           |          |          |         |       | postgres=CTc/postgres
 template1 | postgres | UTF8     | C       | C     | =c/postgres          +
           |          |          |         |       | postgres=CTc/postgres
 vnera     | postgres | UTF8     | C       | C     |
(4 rows)

On Fri, Jul 13, 2018 at 11:56 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
Debraj Manna <subharaj.manna@xxxxxxxxx> writes:
> Can someone let me know if I am not passing any locale while doing initdb
> what locale (Collate & Ctype) will postgres 9.5.4 pick?

Whatever is the prevailing default in initdb's environment ---
see LANG and LC_XXX environment variables.

If none of those are set, I imagine it'll fall back to C locale,
though this choice is possibly dependent on your local libc.
"man locale" might be informative.

                        regards, tom lane


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux