pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryn Llewellyn <bryn@yugabyte.com>
To: Tom Lane PostgreSQL <tgl@sss.pgh.pa.us>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Cc: david.g.johnston@gmail.com
Subject: Re: I slipped up so that no existing role allows connection. Is rescue possible?
Date: Mon, 19 Sep 2022 16:15:11 -0700
Message-ID: <4EC41A45-78DA-4CB6-B11D-33BCF8288FD9@yugabyte.com> (raw)
In-Reply-To: <537913.1663625738@sss.pgh.pa.us>
References: <90C875A7-12B9-4667-BE38-17DFB7C44B0C@yugabyte.com>
	<537913.1663625738@sss.pgh.pa.us>

> tgl@sss.pgh.pa.us wrote:
> 
>> bryn@yugabyte.com writes:
>> 
>> Is rescue possible? Or must I simply remove my cluster and use "pg_ctl" to create a new one within my existing PG 14.5 software env?
> 
> Stop the cluster, start a single-user session ("postgres --single"), re-grant superuser to the postgres user and/or whatever else you wish you could take back, end that session, restart the cluster.

So nice to find this waiting for me when I got back to the keyboard after a late lunch. Thanks, Tom. And thanks to David, too who said much the same. I'll note how I spelled the magic—as a little memo for me:

postgres --single -D /usr/local/var/postgres postgres

The world that the "backend> " prompt opened up for me was rather basic. But even so, "alter user postgres with superuser" worked fine. (This was the only rescue that I needed.) And, after a normal restart, everything looks normal again now from the psql prompt.

This leads to some follow-up questions. But I'll start a new thread.

view thread (10+ messages)  latest in thread

Message-ID: <4EC41A45-78DA-4CB6-B11D-33BCF8288FD9@yugabyte.com>
Permalink:  ../4EC41A45-78DA-4CB6-B11D-33BCF8288FD9@yugabyte.com/
Also on:    postgresql.org/message-id/4EC41A45-78DA-4CB6-B11D-33BCF8288FD9@yugabyte.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bryn@yugabyte.com, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com
  Subject: Re: I slipped up so that no existing role allows connection. Is rescue possible?
  In-Reply-To: <4EC41A45-78DA-4CB6-B11D-33BCF8288FD9@yugabyte.com>
  References: <90C875A7-12B9-4667-BE38-17DFB7C44B0C@yugabyte.com> <537913.1663625738@sss.pgh.pa.us> <4EC41A45-78DA-4CB6-B11D-33BCF8288FD9@yugabyte.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox