Re: per-database locale: createdb switches

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: per-database locale: createdb switches
Date: 2009-01-14 03:27:02
Message-ID: 200901140327.n0E3R2420077@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Bruce Momjian wrote:
> >>>>>> You missed updating the sgml docs, and personally I'd be inclined to
> >>>>>> list -l before the individual --lc switches; otherwise it looks fine.
> >>>>> Thanks, committed that way. I noticed that --lc-ctype and --lc-collate
> >>>>> were forgotten in SGML docs, so I added them too.
> >>>> Should we have a shorthand CREATE DATABASE option like that as well?
> >>> createdb is really about convenience; not sure it is warranted for
> >>> CREATE DATABASE.
> >> I think unless you are doing something completely funny, you would
> >> usually want to have COLLATE and CTYPE equal. The fact that you now
> >> have to enter both to get that result could be pretty annoying in
> >> practice, I would think.
> >
> > I agree but I can't think of many cases where we offer one option which
> > controls two other options; can you?
>
> We have cases like that:
>
> initdb --locale
> createdb --locale
>
> It looks to me, however, that there is possible confusion about what
> createdb --locale (as well as any possible option to be added to CREATE
> DATABASE) really affects:
>
> initdb --locale controls --lc-ctype, --lc-collate, --lc-messages,
> --lc-monetary, --lc-numeric, --lc-time.
>
> createdb --locale only controls --lc-ctype and --lc-collate. The
> functionality to have database-specific settings of the other locale
> categories already exists, so why shouldn't those be set as well?
>
> Which raises yet another question, why CTYPE and COLLATE have to be
> hardcoded settings and catalog columns instead of being stored in
> datconfig as database-startup-only settings?

I was asking for cases where _SQL_ commands have one parameter that
controls two others, not command-line examples. Can you think of any?

FYI, I am fine adding the SQL-level option, I was just asking.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2009-01-14 03:32:06 Re: Proposal: new border setting in psql
Previous Message Tom Lane 2009-01-14 03:23:53 Re: A single escape required for log_filename