From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KJRIHlATIF/TLAAA0tVLHw (envelope-from ) for ; Tue, 28 Jul 2020 12:00:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ABsbGlATIF/7BAAAB5/wlQ (envelope-from ) for ; Tue, 28 Jul 2020 12:00:16 +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 41C3C9403EC for ; Tue, 28 Jul 2020 12:00:16 +0000 (UTC) Received: from localhost ([::1]:40154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0OHH-00053X-5i for larch@yhetil.org; Tue, 28 Jul 2020 08:00:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0OH6-00053A-5a for guix-patches@gnu.org; Tue, 28 Jul 2020 08:00:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k0OH5-0005Op-RK for guix-patches@gnu.org; Tue, 28 Jul 2020 08:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k0OH5-0002Fh-OP for guix-patches@gnu.org; Tue, 28 Jul 2020 08:00:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41786] [PATCH 2/2] 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: Tue, 28 Jul 2020 12:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41786 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41786@debbugs.gnu.org Received: via spool by 41786-submit@debbugs.gnu.org id=B41786.15959375438499 (code B ref 41786); Tue, 28 Jul 2020 12:00:03 +0000 Received: (at 41786) by debbugs.gnu.org; 28 Jul 2020 11:59:03 +0000 Received: from localhost ([127.0.0.1]:57484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0OG7-0002Cv-Eq for submit@debbugs.gnu.org; Tue, 28 Jul 2020 07:59:03 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:48267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0OG5-0002CJ-Jf for 41786@debbugs.gnu.org; Tue, 28 Jul 2020 07:59:02 -0400 X-Originating-IP: 86.246.37.13 Received: from localhost.localdomain (lfbn-idf2-1-572-13.w86-246.abo.wanadoo.fr [86.246.37.13]) (Authenticated sender: mail@ambrevar.xyz) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 5A6A11BF209 for <41786@debbugs.gnu.org>; Tue, 28 Jul 2020 11:58:55 +0000 (UTC) From: Pierre Neidhardt Date: Tue, 28 Jul 2020 13:58:36 +0200 Message-Id: <20200728115836.23440-2-mail@ambrevar.xyz> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200728115836.23440-1-mail@ambrevar.xyz> References: <87tuxujz52.fsf@gmail.com> <20200728115836.23440-1-mail@ambrevar.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.2 (-) 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: XZQHqd/V1r3n * 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 74c7417174..aba3f925b9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17260,6 +17260,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 -u 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.27.0