Skip site navigation (1) Skip section navigation (2)

check_locale() and the empty string

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: check_locale() and the empty string
Date: 2012-03-11 18:20:04
Message-ID: 1331490004.6425.20.camel@jdavis (view raw or flat)
Thread:
Lists: pgsql-bugs
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
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 according  to  the  environment  variables.   The details
  are implementation-dependent.

Surely we don't want it to be set from the environment, right?

Regards,
	Jeff Davis


Responses

pgsql-bugs by date

Next:From: Josh KupershmidtDate: 2012-03-11 19:14:49
Subject: Re: BUG #6524: lpermission denied to create extension "ltree". Must be superuser to create this extension.
Previous:From: koizumistrDate: 2012-03-11 05:41:41
Subject: BUG #6525: t_infomask2 is uint16, not int16

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group