Re: Add CREATE DATABASE LOCALE option - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Add CREATE DATABASE LOCALE option
Date
Msg-id c30f4743-1c81-0d78-66b8-d190daf49c27@iki.fi
Whole thread Raw
In response to Add CREATE DATABASE LOCALE option  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On 05/06/2019 23:17, Peter Eisentraut wrote:
> I propose this patch to add a LOCALE option to CREATE DATABASE.  This
> sets both LC_COLLATE and LC_CTYPE with one option.  Similar behavior is
> already supported in initdb, CREATE COLLATION, and createdb.
> 
> With collation providers other than libc, having separate lc_collate and
> lc_ctype settings is not necessarily applicable, so this is also
> preparation for such future functionality.

One objection is that the proposed LOCALE option would only affect 
LC_COLLATE and LC_CTYPE. What about lc_messages, lc_monetary, lc_numeric 
and lc_time? initdb's --locale option sets those, too. Should CREATE 
DATABASE LOCALE set those as well?

On the whole, +1 on adding the option. In practice, you always want to 
set LC_COLLATE and LC_CTYPE to the same value, so we should make that 
easy. But let's consider those other variables too, at least we've got 
to document it carefully.


PS. There was some discussion on doing this when the LC_COLLATE and 
LC_CTYPE options were added: 
https://www.postgresql.org/message-id/491862F7.1060501%40enterprisedb.com. 
My reading of that is that there was no strong consensus, so we just let 
it be.

- Heikki



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: UCT (Re: pgsql: Update time zone data files to tzdata release2019a.)
Next
From: Daniel Gustafsson
Date:
Subject: Re: pg_upgrade: Improve invalid option handling