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 1oaPz1-0006FR-T9 for pgsql-general@arkaria.postgresql.org; Mon, 19 Sep 2022 23:15:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oaPz0-0002Ye-JV for pgsql-general@arkaria.postgresql.org; Mon, 19 Sep 2022 23:15:22 +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 1oaPz0-0002YU-7D for pgsql-general@lists.postgresql.org; Mon, 19 Sep 2022 23:15:22 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oaPyt-00024v-LK for pgsql-general@lists.postgresql.org; Mon, 19 Sep 2022 23:15:21 +0000 Received: by mail-pg1-x532.google.com with SMTP id bh13so782683pgb.4 for ; Mon, 19 Sep 2022 16:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yugabyte.com; s=google; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date; bh=m5ux+QcXh3Ossfxw+BMpFV4OeXs2aoeJ430Bv22Up7s=; b=JCW7fa4FQyPVrD431PiuM4LYbVlm7WY/qksCbgQnUXrRjSHhIUUaVIoL2FUd7WeYzk 9hvRJqOelH+NBCsv/qp2tZTgbMbCD29UNpXKZ/PHY4P0KeGdVai+BSdxcZ0tJmntxur1 KEY0gOJgMgzS6elVdg+WW4WfzwVZ8thCcP5po= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date; bh=m5ux+QcXh3Ossfxw+BMpFV4OeXs2aoeJ430Bv22Up7s=; b=dSxk8M5sAo+TXF0sim5IlmbYHg6nUotXeSYcejN/GvRxlYnLdUm3NlTSelEAszMsyM 2V/aF3Av9KmU5LfeNc7Ld7niRG3O1AZ6BD4aucC+P57oWKKaPcRkjdnXZlHuuT9I0TTe 2FAXN69sbEVQQwWWzV0y4MAZvDPzOw0ii1wzs23xuevtQ6UavJQfQjyR7DFKXWQLiefg XaEh/JlAGzPCTM5tViI4QOvERnqq3At82G6K+a/389F1mV8eCRfEkhG5R0+6P+a4KlGU r9J1JM3QkJPj5+YTwejIQvDzmhGtLfWkHaBbmvuiVgcyEzSKCx5yqY5irma9oLXLEW24 Bsow== X-Gm-Message-State: ACrzQf2zR9x9XpAMj9S+PPfu3XMALdHYxWKvdM36edl1TpsGBu4zg4go GU9eOLM3GcmG5YX54l+dzXUigg== X-Google-Smtp-Source: AMsMyM6dPycRODrOTElA6oaG6/H848p8PMquM4K65DP+uZcgaIiNhqZwemqNkgxhdsCiOSHA5PdBPQ== X-Received: by 2002:a63:1864:0:b0:439:4c72:429a with SMTP id 36-20020a631864000000b004394c72429amr18037986pgy.35.1663629313199; Mon, 19 Sep 2022 16:15:13 -0700 (PDT) Received: from smtpclient.apple ([2601:646:101:7fda:e52a:6fcc:f9f:ee9]) by smtp.gmail.com with ESMTPSA id i17-20020a056a00225100b0053e62b6fd22sm20907222pfu.126.2022.09.19.16.15.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Sep 2022 16:15:12 -0700 (PDT) From: Bryn Llewellyn Message-Id: <4EC41A45-78DA-4CB6-B11D-33BCF8288FD9@yugabyte.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_DE2937DD-6C04-4316-8616-86BE3987B5EE" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: I slipped up so that no existing role allows connection. Is rescue possible? Date: Mon, 19 Sep 2022 16:15:11 -0700 In-Reply-To: <537913.1663625738@sss.pgh.pa.us> Cc: pgsql-general list , david.g.johnston@gmail.com To: Tom Lane PostgreSQL References: <90C875A7-12B9-4667-BE38-17DFB7C44B0C@yugabyte.com> <537913.1663625738@sss.pgh.pa.us> X-Mailer: Apple Mail (2.3654.120.0.1.13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_DE2937DD-6C04-4316-8616-86BE3987B5EE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > tgl@sss.pgh.pa.us wrote: >=20 >> bryn@yugabyte.com writes: >>=20 >> 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? >=20 > 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=E2=80=94as 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. --Apple-Mail=_DE2937DD-6C04-4316-8616-86BE3987B5EE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
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=E2=80=94as 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.

= --Apple-Mail=_DE2937DD-6C04-4316-8616-86BE3987B5EE--