Re: [BUGS] check_locale() and the empty string

2012-03-25 Thread Tom Lane
Jeff Davis writes: > On Sat, 2012-03-24 at 19:07 -0400, Tom Lane wrote: >> Jeff Davis writes: >>> Surely we don't want it to be set from the environment, right? >> Why not? > I agree that we shouldn't change the documented behavior of those GUCs. > But a SQL command like CREATE DATABASE being e

Re: [BUGS] check_locale() and the empty string

2012-03-25 Thread Jeff Davis
On Sat, 2012-03-24 at 19:07 -0400, Tom Lane wrote: > Jeff Davis writes: > > Surely we don't want it to be set from the environment, right? > > Why not? I agree that we shouldn't change the documented behavior of those GUCs. But a SQL command like CREATE DATABASE being environment sensitive does

Re: [BUGS] check_locale() and the empty string

2012-03-24 Thread Tom Lane
Jeff Davis writes: > The following SQL succeeds: > create database foodb with > template = template0 > encoding = 'UTF8' > lc_collate='' > lc_ctype=''; Sure. > Surely we don't want it to be set from the environment, right? Why not? We have always done that, and in fact the va

Re: [BUGS] check_locale() and the empty string

2012-03-12 Thread Jeff Davis
On Sun, 2012-03-11 at 11:20 -0700, Jeff Davis wrote: > The problem seems to be in check_locale(), which just checks for a > non-NULL return value from setlocale(). However, the manual for > setlocale() says: > > If locale is "", each part of the locale that should be modified > is set accordin

[BUGS] check_locale() and the empty string

2012-03-11 Thread Jeff Davis
The following SQL succeeds: create database foodb with template = template0 encoding = 'UTF8' lc_collate='' lc_ctype=''; (any other template fails because it actually checks for a match against the template). The problem seems to be in check_locale(), which just checks for a no