all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: 43771@debbugs.gnu.org
Subject: [bug#43771] [PATCH 5/5] Don't specify a default postgresql version to use for the service
Date: Fri,  2 Oct 2020 19:40:59 +0100	[thread overview]
Message-ID: <20201002184059.29033-5-mail@cbaines.net> (raw)
In-Reply-To: <20201002184059.29033-1-mail@cbaines.net>

Currently, if the postgresql package major version changes, this is going to
break the service upon upgrade, because PostgreSQL will reject the data files
from the differing major version of the service.

Because it's important to either keep running a particular major version, or
intentionally upgrade, I think the configuration would be better with no
default. I think this is also going to be helpful when trying to assist users
upgrading PostgreSQL.
---
 doc/guix.texi              | 6 ++++--
 gnu/services/databases.scm | 6 ++----
 gnu/tests/databases.scm    | 4 +++-
 gnu/tests/guix.scm         | 1 +
 gnu/tests/monitoring.scm   | 4 +++-
 gnu/tests/web.scm          | 4 +++-
 6 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 641b410acf..4ce0072ed4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17742,7 +17742,9 @@ The following example describes a PostgreSQL service with the default
 configuration.
 
 @lisp
-(service postgresql-service-type)
+(service postgresql-service-type
+         (postgresql-configuration
+          (postgresql postgresql-10)))
 @end lisp
 
 If the services fails to start, it may be due to an incompatible
@@ -17768,7 +17770,7 @@ Data type representing the configuration for the
 @code{postgresql-service-type}.
 
 @table @asis
-@item @var{postgresql} (default: @code{postgresql})
+@item @var{postgresql}
 PostgreSQL package to use for the service.
 
 @item @var{port} (default: @code{5432})
diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index efad182a68..96d2dc4935 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -146,8 +146,7 @@ host	all	all	::1/128 	md5"))
 (define-record-type* <postgresql-configuration>
   postgresql-configuration make-postgresql-configuration
   postgresql-configuration?
-  (postgresql         postgresql-configuration-postgresql ;<package>
-                      (default postgresql))
+  (postgresql         postgresql-configuration-postgresql) ;<package>
   (port               postgresql-configuration-port
                       (default 5432))
   (locale             postgresql-configuration-locale
@@ -278,8 +277,7 @@ host	all	all	::1/128 	md5"))
                        (service-extension account-service-type
                                           (const %postgresql-accounts))
                        (service-extension profile-service-type
-                                          (compose list postgresql-configuration-postgresql))))
-                (default-value (postgresql-configuration))))
+                                          (compose list postgresql-configuration-postgresql))))))
 
 \f
 ;;;
diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm
index e0544bbcd2..d3045cc3f7 100644
--- a/gnu/tests/databases.scm
+++ b/gnu/tests/databases.scm
@@ -215,7 +215,9 @@
 
 (define %postgresql-os
   (simple-operating-system
-   (service postgresql-service-type)))
+   (service postgresql-service-type
+            (postgresql-configuration
+             (postgresql postgresql-10)))))
 
 (define (run-postgresql-test)
   "Run tests in %POSTGRESQL-OS."
diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm
index 6139e31cf0..ebee8d43af 100644
--- a/gnu/tests/guix.scm
+++ b/gnu/tests/guix.scm
@@ -83,6 +83,7 @@
    (service dhcp-client-service-type)
    (service postgresql-service-type
             (postgresql-configuration
+             (postgresql postgresql-10)
              (config-file
               (postgresql-config-file
                (hba-file
diff --git a/gnu/tests/monitoring.scm b/gnu/tests/monitoring.scm
index 17b9edc3ac..7371b02fe1 100644
--- a/gnu/tests/monitoring.scm
+++ b/gnu/tests/monitoring.scm
@@ -307,7 +307,9 @@ zabbix||{}
   (let ((base-os
          (simple-operating-system
           (service dhcp-client-service-type)
-          (service postgresql-service-type)
+          (service postgresql-service-type
+                   (postgresql-configuration
+                    (postgresql postgresql-10)))
           (service zabbix-front-end-service-type
                    (zabbix-front-end-configuration
                     (db-password "zabbix")))
diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm
index 7513eab2e4..7f4518acd2 100644
--- a/gnu/tests/web.scm
+++ b/gnu/tests/web.scm
@@ -567,7 +567,9 @@ HTTP-PORT."
              (config
               (httpd-config-file
                (listen '("8080"))))))
-   (service postgresql-service-type)
+   (service postgresql-service-type
+            (postgresql-configuration
+             (postgresql postgresql-10)))
    (service patchwork-service-type
             (patchwork-configuration
              (patchwork patchwork)
-- 
2.28.0





  parent reply	other threads:[~2020-10-02 18:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 18:36 [bug#43771] [PATCH 0/5] PostgreSQL service improvements Christopher Baines
2020-10-02 18:40 ` [bug#43771] [PATCH 1/5] Replace (postgresql-service) with (service postgresql-service-type) Christopher Baines
2020-10-02 18:40   ` [bug#43771] [PATCH 2/5] Add some subheadings in to the Databases section of the docs Christopher Baines
2020-10-02 18:40   ` [bug#43771] [PATCH 3/5] Remove the postgresql-service procedure Christopher Baines
2020-10-05  8:33     ` Ludovic Courtès
2020-10-19 19:01       ` Christopher Baines
2020-10-02 18:40   ` [bug#43771] [PATCH 4/5] Define postgresql-10 Christopher Baines
2020-10-02 18:40   ` Christopher Baines [this message]
2020-10-05  8:34 ` [bug#43771] [PATCH 0/5] PostgreSQL service improvements Ludovic Courtès
2020-10-19 19:02   ` [bug#43771] [PATCH v2 1/5] tests: monitoring: Use (service postgresql-service-type) Christopher Baines
2020-10-19 19:02     ` [bug#43771] [PATCH v2 2/5] doc: Add subheadings in to the Databases section Christopher Baines
2020-10-19 19:02     ` [bug#43771] [PATCH v2 3/5] services: databases: Deprecate the postgresql-service procedure Christopher Baines
2020-10-19 19:02     ` [bug#43771] [PATCH v2 4/5] gnu: databases: Define postgresql-10 Christopher Baines
2020-10-19 19:02     ` [bug#43771] [PATCH v2 5/5] services: databases: Don't specify a default postgresql version Christopher Baines
2020-10-19 21:02   ` [bug#43771] [PATCH 0/5] PostgreSQL service improvements Christopher Baines
2020-10-20 21:32     ` Ludovic Courtès
2020-10-20 22:41       ` bug#43771: " Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201002184059.29033-5-mail@cbaines.net \
    --to=mail@cbaines.net \
    --cc=43771@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.