Re: I slipped up so that no existing role allows connection. Is rescue possible?

From: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
To: Tom Lane PostgreSQL <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>, david(dot)g(dot)johnston(at)gmail(dot)com
Subject: Re: I slipped up so that no existing role allows connection. Is rescue possible?
Date: 2022-09-19 23:15:11
Message-ID: 4EC41A45-78DA-4CB6-B11D-33BCF8288FD9@yugabyte.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:
>
>> bryn(at)yugabyte(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-09-19 23:28:42 Re: GIST combo index condition chosen for users queries is different from table owner's query
Previous Message Dennis White 2022-09-19 22:47:52 GIST combo index condition chosen for users queries is different from table owner's query