From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: locale warning and postgresql Date: Mon, 28 Nov 2016 23:37:11 +0000 Message-ID: <87bmwzi3bs.fsf@gmail.com> References: <87eg1vitxf.fsf@gmail.com> <877f7nmiu7.fsf@gnu.org> <87d1hfl1je.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBVV5-0006kN-NV for help-guix@gnu.org; Mon, 28 Nov 2016 18:38:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBVV4-0002M6-Nw for help-guix@gnu.org; Mon, 28 Nov 2016 18:38:19 -0500 In-reply-to: <87d1hfl1je.fsf@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Alex Kost Cc: help-guix on [2016-11-28] at 21:47 Alex Kost writes: > Ludovic Courtès (2016-11-28 21:48 +0100) wrote: > >> Hi Myles, >> >> Myles English skribis: >> >>> I have always had trouble with my locale after installing guix on Arch >>> Linux (with zsh and a basic window manager, bspwm). I have set >>> GUIX_LOCPATH in ~/.zshenv and it appears correct in my shell. The >>> system-wide locale looks right. When I install postgresql it gives the >>> usual "warning: failed to install locale: Invalid argument". When I try >>> to initialise a database cluster, passing the locale doesn't work. >>> >>> Does anyone using Arch Linux and a basic WM know which file to put >>> GUIX_LOCPATH in so that the warning goes away? >>> >>> How can I find out what guix thinks its locale is or what are available? >>> >>> Is there a way to use initdb even though there is a locale warning? >>> >>> Shell experiments: >>> >>> $ locale >>> LANG=en_GB.UTF-8 >>> LC_CTYPE="en_GB.UTF-8" >>> LC_NUMERIC="en_GB.UTF-8" >>> LC_TIME="en_GB.UTF-8" >>> LC_COLLATE="en_GB.UTF-8" >>> LC_MONETARY="en_GB.UTF-8" >>> LC_MESSAGES="en_GB.UTF-8" >>> LC_PAPER="en_GB.UTF-8" >>> LC_NAME="en_GB.UTF-8" >>> LC_ADDRESS="en_GB.UTF-8" >>> LC_TELEPHONE="en_GB.UTF-8" >>> LC_MEASUREMENT="en_GB.UTF-8" >>> LC_IDENTIFICATION="en_GB.UTF-8" >>> LC_ALL= >>> >>> $ echo $GUIX_LOCPATH >>> /home/myles/.guix-profile/lib/locale >> >> What does “ls $GUIX_LOCPATH/2.24” show? >> >> You must make sure you have the ‘glibc-locales’ or ‘glibc-utf8-locales’ >> that correspond to the glibc version of the program you are using (if >> you just installed postgresql, it’s using glibc 2.24.) >> >> Then you need to make sure GUIX_LOCPATH is set both in the environment >> of the postgresql daemon, and in the environment of the commands you >> invoke (initdb, etc.). > > Including the guix-daemon, as this warning: > >>> $ guix package -i postgresql >>> warning: failed to install locale: Invalid argument >>> The following package will be upgraded: >>> postgresql 9.5.3 -> 9.5.3 /gnu/store/sfgg20a7jnwfisajsvqdijjm2zj905az-postgresql-9.5.3 > > comes from the daemon, so make sure your "guix-daemon.service" has a > line like this: > > Environment=GUIX_LOCPATH=/root/.guix-profile/lib/locale Thank you, I hadn't installed glibc-utf8-locales for root. Perhaps this step could be added to the documentation in "2.6.1 Locales"? I also might have been using --locale wrong but I still can't get initdb to use one: $ initdb --locale=en_GB -E UTF8 -D '/home/myles/pgdata-guix' The files belonging to this database system will be owned by user "myles". This user must also own the server process. initdb: invalid locale name "en_GB" $ initdb --locale=en_GB.UTF-8 -E UTF8 -D '/home/myles/pgdata-guix' The files belonging to this database system will be owned by user "myles". This user must also own the server process. initdb: invalid locale name "en_GB.UTF-8" $ initdb -D '/home/myles/pgdata-guix' The files belonging to this database system will be owned by user "myles". This user must also own the server process. initdb: invalid locale settings; check LANG and LC_* environment variables Any ideas? Myles