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 6I3QGJ2o4F71eQAA0tVLHw (envelope-from ) for ; Wed, 10 Jun 2020 09:32:13 +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 ALC4FJ2o4F7SCgAA1q6Kng (envelope-from ) for ; Wed, 10 Jun 2020 09:32:13 +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 D4C6994013C for ; Wed, 10 Jun 2020 09:32:12 +0000 (UTC) Received: from localhost ([::1]:57856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jix5e-0000rh-2k for larch@yhetil.org; Wed, 10 Jun 2020 05:32:10 -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 Content-Transfer-Encoding: 8bit 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-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.1 (--) 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: CFQjqk5Q3DK7 * 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, -- 2.26.2