From patchwork Wed Jun 10 09:31:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Neidhardt X-Patchwork-Id: 22635 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E1EB027BBE3; Wed, 10 Jun 2020 10:32:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 9AA7127BBE1 for ; Wed, 10 Jun 2020 10:32:09 +0100 (BST) Received: from localhost ([::1]:57856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jix5d-0000rh-6B for patchwork@mira.cbaines.net; Wed, 10 Jun 2020 05:32:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jix5X-0000pp-0Y for guix-patches@gnu.org; Wed, 10 Jun 2020 05:32:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50123) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jix5W-0007vv-NB for guix-patches@gnu.org; Wed, 10 Jun 2020 05:32:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jix5W-0006ht-K4 for guix-patches@gnu.org; Wed, 10 Jun 2020 05:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41786] [PATCH] doc: Explain how to use psql with peer authentication. Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 10 Jun 2020 09:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41786 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41786@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159178151725769 (code B ref -1); Wed, 10 Jun 2020 09:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Jun 2020 09:31:57 +0000 Received: from localhost ([127.0.0.1]:33436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jix5R-0006hZ-Gu for submit@debbugs.gnu.org; Wed, 10 Jun 2020 05:31:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:60170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jix5Q-0006hR-KC for submit@debbugs.gnu.org; Wed, 10 Jun 2020 05:31:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jix5Q-0000or-Dc for guix-patches@gnu.org; Wed, 10 Jun 2020 05:31:56 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:47379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jix5P-0007vC-7F for guix-patches@gnu.org; Wed, 10 Jun 2020 05:31:55 -0400 Received: from localhost.localdomain (lfbn-idf2-1-1315-147.w92-169.abo.wanadoo.fr [92.169.129.147]) (Authenticated sender: mail@ambrevar.xyz) by relay10.mail.gandi.net (Postfix) with ESMTPSA id DB6C8240006 for ; Wed, 10 Jun 2020 09:31:47 +0000 (UTC) From: Pierre Neidhardt Date: Wed, 10 Jun 2020 11:31:47 +0200 Message-Id: <20200610093147.24347-1-mail@ambrevar.xyz> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Received-SPF: pass client-ip=217.70.178.230; envelope-from=mail@ambrevar.xyz; helo=relay10.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/10 03:51:35 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, FROM_SUSPICIOUS_NTLD=1, FROM_SUSPICIOUS_NTLD_FP=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Database Services): Add example of shell commands to use psql as system user. Also add troubleshooting tip when service fails to start because of incompatible cluster. --- doc/guix.texi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 15e077a41c..1326be69e5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16787,6 +16787,24 @@ 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}. +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 +don't need the cluster anymore, delete @var{data-directory}), then +restart the service. + +Peer authentication is used by default and the @code{postgres} user +account has no shell, which prevents the direct execution of @code{psql} +commands as this user. To use @code{psql}, you can temporarily log in +as @code{postgres} using a shell, create a PostgreSQL superuser with the +same name as one of the system users and then create the associated +database. + +@example +sudo su postgres -s /bin/sh +createuser --interface +createdb $MY_USER_LOGIN # Replace appropriately. +@end example + @cindex postgresql extension-packages Additional extensions are loaded from packages listed in @var{extension-packages}. Extensions are available at runtime. For instance,