[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] services: postgresql: Add locale to configuration
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH 2/2] services: postgresql: Add locale to configuration |
Date: |
Mon, 12 Dec 2016 00:14:39 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hi!
Christopher Baines <address@hidden> skribis:
> * gnu/services/postgresql.scm (<postgresql-configuration>): Add locale
> field.
> (postgresql-shepherd-service): Pass locale to initdb.
> (postgresql-service): Add locale default.
[...]
> + (locale postgresql-configuration-locale
> + (default "en_US.UTF-8"))
Note: this should use the “normalized codeset”, so “en_US.utf8”.
> (let ((user (getpwnam "postgres"))
> - (initdb (string-append #$postgresql "/bin/initdb")))
> + (initdb (string-append #$postgresql "/bin/initdb"))
> + (initdb-args
> + (append
> + (if #$locale
> + (list (string-append "--locale=" #$locale))
> + '()))))
> ;; Create db state directory.
> (mkdir-p #$data-directory)
> (chown #$data-directory (passwd:uid user) (passwd:gid user))
> @@ -103,14 +110,19 @@ host all all ::1/128 trust"))
> (lambda ()
> (setgid (passwd:gid user))
> (setuid (passwd:uid user))
> - (primitive-exit (system* initdb "-D" #$data-directory)))
> + (primitive-exit
> + (apply system*
> + initdb
> + "-D"
> + #$data-directory
> + initdb-args)))
> (lambda ()
> (primitive-exit 1))))
> (pid (waitpid pid))))))))
The effect of that is that ‘initdb’, but not ‘postgresql’ itself, would
run in a locale different from the system locale by default.
These two inconsistencies may be quite confusing. WDYT?
Thanks,
Ludo’.
- [PATCH 1/2] services: postgresql: Add port to configuration, Christopher Baines, 2016/12/11
- [PATCH 2/2] services: postgresql: Add locale to configuration, Christopher Baines, 2016/12/11
- Re: [PATCH 2/2] services: postgresql: Add locale to configuration,
Ludovic Courtès <=
- Re: [PATCH 2/2] services: postgresql: Add locale to configuration, Christopher Baines, 2016/12/12
- Re: [PATCH 2/2] services: postgresql: Add locale to configuration, Ludovic Courtès, 2016/12/13
- [PATCH 1/2] services: postgresql: Add port to configuration, Christopher Baines, 2016/12/14
- [PATCH 2/2] services: postgresql: Add locale to configuration, Christopher Baines, 2016/12/14
- Re: [PATCH 2/2] services: postgresql: Add locale to configuration, Ludovic Courtès, 2016/12/15
- Re: [PATCH 1/2] services: postgresql: Add port to configuration, Ludovic Courtès, 2016/12/15
Re: [PATCH 1/2] services: postgresql: Add port to configuration, Ludovic Courtès, 2016/12/11