Postgresql locale

I have been testing Matrix 3.24 for a little while and am preparing to go from our dev server to prod.


Reading the MySource admin guide recently mentions that postresql performs better if locale is C or POSIX. I checked my postgres locale and sure enough it was UTF8 (we are running Centos 5.3). The admin guide includes the following language setting for Redhat:



In the file:

/etc/sysconfig/i18n change LANG to an undefined variable, for example:

LANG=""



So I made the above change then yum erased postgresql-server and postgres. Yum installed both again, then:


  • su postgres
  • initdb -D /var/lib/pgsql/data --locale=C
  • /etc/init.d/postgres start



    If I now check locale I get this:



    bash-3.2$ locale

    LANG=

    LC_CTYPE="POSIX"

    LC_NUMERIC="POSIX"

    LC_TIME="POSIX"

    LC_COLLATE="POSIX"

    LC_MONETARY="POSIX"

    LC_MESSAGES="POSIX"

    LC_PAPER="POSIX"

    LC_NAME="POSIX"

    LC_ADDRESS="POSIX"

    LC_TELEPHONE="POSIX"

    LC_MEASUREMENT="POSIX"

    LC_IDENTIFICATION="POSIX"

    LC_ALL=



    My /var/lib/pgsql/data/postgresql.conf however shows locale as being C.



    # - Locale and Formatting -



    #datestyle = 'iso, mdy'

    #timezone = unknown # actually, defaults to TZ

    # environment setting

    #australian_timezones = off

    #extra_float_digits = 0 # min -15, max 2

    #client_encoding = sql_ascii # actually, defaults to database

    # encoding


These settings are initialized by initdb – they might be changed

lc_messages = 'C' # locale for system error message

# strings

lc_monetary = 'C' # locale for monetary formatting

lc_numeric = 'C' # locale for number formatting

lc_time = 'C' # locale for time formatting



Anyone know why the postgres locale command shows Posix not C?

I logged a query on the Postgresql mail list and they advised that C and POSIX are one and the same so it is nothing to worry about.

Thanks for posting the outcome of this.