Subject: [bug#45860] Improve PostgreSQL service.

From: Christopher Baines <[email-masked]>
Date: Thu, 14 Jan 2021 21:56:43 +0000

Mathieu Othacehe <[email-masked]> writes:

> Hello,
>
> Here's a patch to improve PostgreSQL service. It merges
> <postgresql-configuration> and <postgresql-config-file> records. It also
> sanitises parameters conversion and logging.
>
> Thanks,
>
> Mathieu
> From 87703b749631acd8ddc2b9eeb36a5be7189a019b Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <[email-masked]>
> Date: Thu, 14 Jan 2021 14:13:30 +0100
> Subject: [PATCH] Improve PostgreSQL service.
>
> Merge <postgresql-configuration> and <postgresql-config-file> records,
> sanitize parameters convertion and logging.
>
> * gnu/services/databases.scm (postgresql-config-file,
> postgresql-config-file?, postgresql-config-file-log-destination,
> postgresql-config-file-hba-file, postgresql-config-file-ident-file,
> postgresql-config-file-extra-config, postgresql-configuration): Remove them.
> (postgresql-configuration-log-destination,
> postgresql-configuration-hba-file,
> postgresql-configuration-ident-file,
> postgresql-configuration-socket-directory,
> postgresql-configuration-extra-config,
> postgresql-configuration-extension-packages): New exported procedures.
> (<postgresql-config-file>): Merge it with ...
> (<postgresql-configuration>): ... this record, and add a "socket-directory"
> field.
> (postgresql-config-file-compiler): Replace it with ...
> (postgresql-config-file): ... this procedure.
> (postgresql-activation): Use "match-record" instead of "match". Create the
> "socket-directory" if needed.
> (postgresql-shepherd-service): Use "match-record" intead of "match". Pass the
> "log-destination" argument to "pg_ctl" if needed.
> (postgresql-service): Remove it.
> * gnu/tests/databases.scm (%postgresql-log-directory): New variable.
> (%postgresql-os): Pass "log-destination" and "extra-config" fields.
> (log-file): New test case.
> * gnu/tests/guix.scm (%guix-data-service-os): Adapt accordingly.
> * doc/guix.texi (Database Services): Ditto.

I haven't read through these changes in detail, but the mixing of the
record describing the config file, and the record for configuring the
service introduces the limitation that you can no longer specify any
lowerable object (like a file) or something like a string to use a
config file outside of the store. Did you have a reason for mixing the
records together?