From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uFjwA450d18QSAAA0tVLHw (envelope-from ) for ; Fri, 02 Oct 2020 18:42:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0HpqO410d1/xOAAA1q6Kng (envelope-from ) for ; Fri, 02 Oct 2020 18:42:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7FF039402A4 for ; Fri, 2 Oct 2020 18:42:21 +0000 (UTC) Received: from localhost ([::1]:37746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOQ0a-0000UR-1l for larch@yhetil.org; Fri, 02 Oct 2020 14:42:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOQ0J-0000U4-GR for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOQ0I-0002LG-Vj for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOQ0I-0002nH-UJ for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH 3/5] Remove the postgresql-service procedure Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Oct 2020 18:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43771 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43771@debbugs.gnu.org Received: via spool by 43771-submit@debbugs.gnu.org id=B43771.160166406510645 (code B ref 43771); Fri, 02 Oct 2020 18:42:02 +0000 Received: (at 43771) by debbugs.gnu.org; 2 Oct 2020 18:41:05 +0000 Received: from localhost ([127.0.0.1]:42568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzN-0002lX-8G for submit@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:05 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzK-0002ko-Rx for 43771@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:03 -0400 Received: from localhost (188.28.111.33.threembb.co.uk [188.28.111.33]) by mira.cbaines.net (Postfix) with ESMTPSA id 2B24C27BBEA for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 19:41:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 61143908 for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 18:40:59 +0000 (UTC) From: Christopher Baines Date: Fri, 2 Oct 2020 19:40:57 +0100 Message-Id: <20201002184059.29033-3-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201002184059.29033-1-mail@cbaines.net> References: <20201002184059.29033-1-mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 3.99 X-TUID: pz4Qz/Jm7zOG It's unnecessary, using the service type directly is a better approach. While this is unfortunately a breaking change, I'm also looking at making breaking changes to the service type configuration, so I don't think this can be avoided. --- doc/guix.texi | 40 +++++++++++++++++++++++++++++--------- gnu/services/databases.scm | 19 ------------------ 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4197cd562a..641b410acf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17738,15 +17738,12 @@ The @code{(gnu services databases)} module provides the following services. @subsubheading PostgreSQL -@deffn {Scheme Procedure} postgresql-service [#:postgresql postgresql] @ - [#:config-file] [#:data-directory ``/var/lib/postgresql/data''] @ - [#:port 5432] [#:locale ``en_US.utf8''] [#:extension-packages '()] -Return a service that runs @var{postgresql}, the PostgreSQL database -server. +The following example describes a PostgreSQL service with the default +configuration. -The PostgreSQL daemon loads its runtime configuration from @var{config-file}, -creates a database cluster with @var{locale} as the default -locale, stored in @var{data-directory}. It then listens on @var{port}. +@lisp +(service postgresql-service-type) +@end lisp If the services fails to start, it may be due to an incompatible cluster already present in @var{data-directory}. Adjust it (or, if you @@ -17766,6 +17763,29 @@ createuser --interactive createdb $MY_USER_LOGIN # Replace appropriately. @end example +@deftp {Data Type} postgresql-configuration +Data type representing the configuration for the +@code{postgresql-service-type}. + +@table @asis +@item @var{postgresql} (default: @code{postgresql}) +PostgreSQL package to use for the service. + +@item @var{port} (default: @code{5432}) +Port on which PostgreSQL should listen. + +@item @var{locale} (default: @code{"en_US.utf8"}) +Locale to use as the default when creating the database cluster. + +@item @var{config-file} (default: @code{(postgresql-config-file)}) +The configuration file to use when running PostgreSQL. The default +behaviour uses the postgresql-config-file record with the default values +for the fields. + +@item @var{data-directory} (default: @code{"/var/lib/postgresql/data"}) +Directory in which to store the data. + +@item @var{extension-packages} (default: @code{'()}) @cindex postgresql extension-packages Additional extensions are loaded from packages listed in @var{extension-packages}. Extensions are available at runtime. For instance, @@ -17801,7 +17821,9 @@ psql -U postgres There is no need to add this field for contrib extensions such as hstore or dblink as they are already loadable by postgresql. This field is only required to add extensions provided by other packages. -@end deffn + +@end table +@end deftp @subsubheading MariaDB/MySQL diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index 2bddf70f71..efad182a68 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -281,25 +281,6 @@ host all all ::1/128 md5")) (compose list postgresql-configuration-postgresql)))) (default-value (postgresql-configuration)))) -(define* (postgresql-service #:key (postgresql postgresql) - (port 5432) - (locale "en_US.utf8") - (config-file (postgresql-config-file)) - (data-directory "/var/lib/postgresql/data") - (extension-packages '())) - "Return a service that runs @var{postgresql}, the PostgreSQL database server. - -The PostgreSQL daemon loads its runtime configuration from @var{config-file} -and stores the database cluster in @var{data-directory}." - (service postgresql-service-type - (postgresql-configuration - (postgresql postgresql) - (port port) - (locale locale) - (config-file config-file) - (data-directory data-directory) - (extension-packages extension-packages)))) - ;;; ;;; Memcached -- 2.28.0