X-Loop: help-debbugs@HIDDEN Subject: [bug#63926] [PATCH] services: postgresql: Add more role fields. Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Moreno <me@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Tue, 06 Jun 2023 13:50:02 +0000 Resent-Message-ID: <handler.63926.B.16860593936072 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 63926 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63926 <at> debbugs.gnu.org Cc: me@HIDDEN X-Debbugs-Original-To: guix-patches@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.16860593936072 (code B ref -1); Tue, 06 Jun 2023 13:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Jun 2023 13:49:53 +0000 Received: from localhost ([127.0.0.1]:51231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1q6X4K-0001Zm-AF for submit <at> debbugs.gnu.org; Tue, 06 Jun 2023 09:49:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:47854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1q6SzZ-0006xt-8Q for submit <at> debbugs.gnu.org; Tue, 06 Jun 2023 05:28:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1q6SzZ-0004kO-2E for guix-patches@HIDDEN; Tue, 06 Jun 2023 05:28:41 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1q6SzX-0006Wh-9o for guix-patches@HIDDEN; Tue, 06 Jun 2023 05:28:40 -0400 X-GND-Sasl: me@HIDDEN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mianmoreno.com; s=gm1; t=1686043717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D5t8CXyoCjk7qAwTrY/4JaJY5oNibLod+NyBX27gmls=; b=bzeSQo3Gk187DT8TIQ1h/cEiPv81wO7ihavPUT1lJkb8ONiAgey5X/jwDfySAAZvtNjyg9 Zc3827MYBNtl3iM2VFh6JJA18vNGOJjzyLMfrpG9Kcnr77PKcvRjSIOOryAsUc2brQnmho w0rGD1MWIPsngfeblqay3IRmN+LGxsDl06QKfsbayE1XP/44grFCOd8kUJIf5MvZHavzON bjH9x7VZTL54lZH5MmOJYcIHZE4mzlf4fRB6S4gE0y4FHVGTjSmIFDogHZLiTfZST0UU+S vbvEwg7N8h70VfwKN/XkcZKEV5OzkieXufViK3zT+dNuRH1zT/Dfl6hPIM1hhQ== X-GND-Sasl: me@HIDDEN Received: by mail.gandi.net (Postfix) with ESMTPSA id 7624E40015; Tue, 6 Jun 2023 09:28:35 +0000 (UTC) From: Miguel =?UTF-8?Q?=C3=81ngel?= Moreno <me@HIDDEN> Date: Tue, 06 Jun 2023 11:28:35 +0200 Message-ID: <86legxos70.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=217.70.183.194; envelope-from=me@HIDDEN; helo=relay2-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Mailman-Approved-At: Tue, 06 Jun 2023 09:49:41 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.6 (--) * gnu/services/databases.scm (postgresql-role): Add more role fields. (postgresql-create-roles): Honor it. * doc/guix.texi (Database Services): Document it. --- doc/guix.texi | 16 +++++++++++++++- gnu/services/databases.scm | 19 ++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 60972f408d..e384a3a13d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -24784,7 +24784,21 @@ Database Services @code{superuser}. =20 @item @code{create-database?} (default: @code{#f}) -Whether to create a database with the same name as the role. +whether to create a database with the same name as the role. + +@item @code{encoding} (default: @code{"UTF8"}) +The character set to use for storing text in the database. + +@item @code{collation} (default: @code{"en_US.utf8"}) +The string sort order locale setting. + +@item @code{ctype} (default: @code{"en_US.utf8"}) +The character classification locale setting. + +@item @code{template} (default: @code{"template1"}) +The default template to copy the new database from when creating it. +Use @code{"template0"} for a pristine database with no system-local +modifications. =20 @end table @end deftp diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index e8e42d3b7b..7148971c1d 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -363,7 +363,15 @@ (define-record-type* <postgresql-role> (permissions postgresql-role-permissions (default '(createdb login))) ;list (create-database? postgresql-role-create-database? ;boolean - (default #f))) + (default #f)) + (encoding postgresql-role-encoding ;string + (default "UTF8")) + (collation postgresql-role-collation ;string + (default "en_US.utf8")) + (ctype postgresql-role-ctype ;string + (default "en_US.utf8")) + (template postgresql-role-template ;string + (default "template1"))) =20 (define-record-type* <postgresql-role-configuration> postgresql-role-configuration make-postgresql-role-configuration @@ -392,7 +400,8 @@ (define (postgresql-create-roles config) (append-map (lambda (role) (match-record role <postgresql-role> - (name permissions create-database?) + (name permissions create-database? encoding collation ctype + template) `("SELECT NOT(EXISTS(SELECT 1 FROM pg_catalog.pg_roles WHE= RE \ rolname =3D '" ,name "')) as not_exists;\n" "\\gset\n" @@ -402,7 +411,11 @@ (define (postgresql-create-roles config) ";\n" ,@(if create-database? `("CREATE DATABASE \"" ,name "\"" - " OWNER \"" ,name "\";\n") + " OWNER \"" ,name "\"\n" + " ENCODING '" ,encoding "'\n" + " LC_COLLATE '" ,collation "'\n" + " LC_CTYPE '" ,ctype "'\n" + " TEMPLATE " ,template ";") '()) "\\endif\n"))) roles))) --=20 2.40.1 --=20 Best regards, Miguel =C3=81ngel Moreno
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Miguel =?UTF-8?Q?=C3=81ngel?= Moreno <me@HIDDEN> Subject: bug#63926: Acknowledgement ([PATCH] services: postgresql: Add more role fields.) Message-ID: <handler.63926.B.16860593936072.ack <at> debbugs.gnu.org> References: <86legxos70.fsf@HIDDEN> X-Gnu-PR-Message: ack 63926 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 63926 <at> debbugs.gnu.org Date: Tue, 06 Jun 2023 13:50:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): guix-patches@HIDDEN If you wish to submit further information on this problem, please send it to 63926 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 63926: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63926 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: [bug#63926] [PATCH] services: postgresql: Add more role fields. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Wed, 14 Jun 2023 10:39:01 +0000 Resent-Message-ID: <handler.63926.B63926.168673912921223 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 63926 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Miguel =?UTF-8?Q?=C3=81ngel?= Moreno <me@HIDDEN> Cc: Christopher Baines <mail@HIDDEN>, 63926 <at> debbugs.gnu.org Received: via spool by 63926-submit <at> debbugs.gnu.org id=B63926.168673912921223 (code B ref 63926); Wed, 14 Jun 2023 10:39:01 +0000 Received: (at 63926) by debbugs.gnu.org; 14 Jun 2023 10:38:49 +0000 Received: from localhost ([127.0.0.1]:43811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1q9Nto-0005WE-T0 for submit <at> debbugs.gnu.org; Wed, 14 Jun 2023 06:38:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1q9Ntm-0005W2-NC for 63926 <at> debbugs.gnu.org; Wed, 14 Jun 2023 06:38:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1q9Ntf-0005XS-Go; Wed, 14 Jun 2023 06:38:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=b6utA5TiVy2gyTr619GJ2ldZclNBxq9p/L3OQq4NH9M=; b=gY0k/O7A18Vxh4mT+fxt qUjsCGyXDrrJCROoUzbg+0KrPbsqKYCPYQfqXZFZ1Bipa65TqsMhw5I7fJf3InHkLHuDNLh5rcvSd YQ9RjnzdymROJuclueHyVci7F/GklCb/GkWJL78n2KRfst/awf8CwGW15TINv3siKR4iw8pwhu5Ci Uy8tZlmQ8itJVQfklvnm/+kbTb5ywQTHPiypvc8BDthWvufPsKzKYdAQjq6sgz5rKQ0ehglkt4Uir p47YCP2hzurw9NNikCGWiYHz5xeV+8nL2gbS/2Hj9jCRMm/dU0npx8NpoALmqp8BuuTSMSOLEwrMi jhsfaVrQOY5jpQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1q9Ntf-0005C1-3y; Wed, 14 Jun 2023 06:38:39 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> References: <86legxos70.fsf@HIDDEN> Date: Wed, 14 Jun 2023 12:38:36 +0200 In-Reply-To: <86legxos70.fsf@HIDDEN> ("Miguel =?UTF-8?Q?=C3=81ngel?= Moreno"'s message of "Tue, 06 Jun 2023 11:28:35 +0200") Message-ID: <87v8fqs503.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, (Cc: Christopher Baines who knows pgsql better than I do.) Miguel =C3=81ngel Moreno <me@HIDDEN> skribis: > * gnu/services/databases.scm (postgresql-role): Add more role fields. > (postgresql-create-roles): Honor it. > * doc/guix.texi (Database Services): Document it. That looks like an improvement! Some comments: > @item @code{create-database?} (default: @code{#f}) > -Whether to create a database with the same name as the role. > +whether to create a database with the same name as the role. This change is unnecessary (leftover?). > +@item @code{encoding} (default: @code{"UTF8"}) > +The character set to use for storing text in the database. Or "UTF-8"? It might be worth mentioning the naming convention for encodings, especially if it differs from <http://www.iana.org/assignments/character-sets>. > +@item @code{collation} (default: @code{"en_US.utf8"}) > +The string sort order locale setting. > + > +@item @code{ctype} (default: @code{"en_US.utf8"}) > +The character classification locale setting. > + > +@item @code{template} (default: @code{"template1"}) > +The default template to copy the new database from when creating it. > +Use @code{"template0"} for a pristine database with no system-local > +modifications. Are these defaults equivalent to those that were previously in effect? If would be ideal. Thanks, and apologies for the delay! Ludo=E2=80=99.
Received: (at control) by debbugs.gnu.org; 8 Oct 2023 21:32:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 08 17:32:16 2023 Received: from localhost ([127.0.0.1]:58783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qpbNn-00053n-U1 for submit <at> debbugs.gnu.org; Sun, 08 Oct 2023 17:32:16 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:54490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1qpbNl-00053S-7g for control <at> debbugs.gnu.org; Sun, 08 Oct 2023 17:32:14 -0400 Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludo@HIDDEN; dmarc=fail (p=none dis=none) d=gnu.org X-IronPort-AV: E=Sophos;i="6.03,207,1694728800"; d="scan'208";a="68094669" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2023 23:31:46 +0200 Date: Sun, 08 Oct 2023 23:31:45 +0200 Message-Id: <871qe4yf5q.fsf@HIDDEN> To: control <at> debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> Subject: control message for bug #63926 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) tags 63926 + moreinfo quit
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.