Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 8C66631C0C7 for ; Sun, 11 Mar 2012 15:20:21 -0300 (ADT) Received: from mail-pz0-f46.google.com ([209.85.210.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S6nNU-0001C9-Cr for pgsql-bugs@postgresql.org; Sun, 11 Mar 2012 18:20:20 +0000 Received: by dajr28 with SMTP id r28so4033942daj.19 for ; Sun, 11 Mar 2012 11:20:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:date:content-type:x-mailer :content-transfer-encoding:mime-version:x-gm-message-state; bh=//r7yLw6SN+Wf2puC4tCvUZCNThsTufiGYXh4sgduog=; b=otB0mvF3Fb9cxKt8sAldBfHlDT6TwcFviM8MZuSa1+5A9QwRhFk3oWGy3tsk1la+Sz IN0MmrZ9W1FsCDRhlpv16weqKs2xzA+t2U7dPi5jDZOO+3OKCHe+a5kAgXrdkMVGRJwj 9MNsy5rhqpC4yDHlPS2kmYO3aoRiEOoNGxrNn7hU42bo3lkNQdmvc3ShP9n41Rea8yCf JAQEaLxI8zKNN7GK/BMrM3uR3VgX04wSv1mgGkHxCaGt+Id+ls9vC/XuuChkvfcp7Z5/ VXsRly484QlK2FtbefbC2VodvDbw8sgYB9l4Ano2DwSu27IQAdt1JTmvL/CCufVwxr6b Z/Bw== Received: by 10.68.130.106 with SMTP id od10mr11073366pbb.91.1331490007313; Sun, 11 Mar 2012 11:20:07 -0700 (PDT) Received: from [192.168.1.103] (c-69-181-249-16.hsd1.ca.comcast.net. [69.181.249.16]) by mx.google.com with ESMTPS id f5sm8599091pbe.26.2012.03.11.11.20.03 (version=SSLv3 cipher=OTHER); Sun, 11 Mar 2012 11:20:03 -0700 (PDT) Message-ID: <1331490004.6425.20.camel@jdavis> Subject: check_locale() and the empty string From: Jeff Davis To: pgsql-bugs@postgresql.org Date: Sun, 11 Mar 2012 11:20:04 -0700 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Gm-Message-State: ALoCoQlMmA85YgCDpByxlNm/L+g3fkzh0KYB6qROtqRYLI1+LLa21n49L02xrjYy2rMUZXiqpI5/ X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201203/75 X-Sequence-Number: 32636 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