Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxqaH-0001zO-9R for pgsql-admin@arkaria.postgresql.org; Wed, 23 Nov 2022 14:18:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oxqaF-0001rC-83 for pgsql-admin@arkaria.postgresql.org; Wed, 23 Nov 2022 14:18:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxqaE-0001r3-U5 for pgsql-admin@lists.postgresql.org; Wed, 23 Nov 2022 14:18:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxqaC-0007Ht-LX for pgsql-admin@lists.postgresql.org; Wed, 23 Nov 2022 14:18:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2ANEIVUV3693543; Wed, 23 Nov 2022 09:18:31 -0500 From: Tom Lane To: Holger Jakobs cc: pgsql-admin@lists.postgresql.org Subject: Re: postgres (superuser) cannot connect to database In-reply-to: <82e7c3a1-7ab8-0b2e-910e-26946f27dde6@jakobs.com> References: <82e7c3a1-7ab8-0b2e-910e-26946f27dde6@jakobs.com> Comments: In-reply-to Holger Jakobs message dated "Wed, 23 Nov 2022 13:41:39 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3693541.1669213111.1@sss.pgh.pa.us> Date: Wed, 23 Nov 2022 09:18:31 -0500 Message-ID: <3693542.1669213111@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Holger Jakobs writes: > How come a user who has issued "set role to postgres", so that the > current user is postgres, cannot connect to a database? \c makes a fresh connection to the server. SET ROLE in your old session will not carry over to that (nor any other session state). regards, tom lane