public inbox for [email protected]  
help / color / mirror / Atom feed
From: Holger Jakobs <[email protected]>
To: [email protected]
Subject: Re: How to make superuser from non superuser in PostgreSQL
Date: Thu, 19 Sep 2024 17:50:27 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwZQHrFDsy3C5kL+atJD-dEj+YEXdN0inci1aq-fbCROrg@mail.gmail.com>
References: <CAEQOu1F5NDuv556QtNyqFEPyu4r+3SJAeTsSwGDU6_ECCEDxOA@mail.gmail.com>
	<CAKFQuwZQHrFDsy3C5kL+atJD-dEj+YEXdN0inci1aq-fbCROrg@mail.gmail.com>

If the database system is running on a machine you have access to, you might start it in single user mode and establish a new superuser role or change the password. 

Directly from SQL this isn't possible as it would make all restrictions useless. 

-- 
Holger Jakobs, Bergisch Gladbach 
Tel. +49 178 9759012

Am 19. September 2024 17:06:57 MESZ schrieb "David G. Johnston" <[email protected]>:
>On Thursday, September 19, 2024, Sunil Jadhav <[email protected]>
>wrote:
>
>>
>> I don't know the superuser password?
>>
>>
>You will need to figure out a way to login as the (an?) existing
>superuser.  Typically a password is not required since the pg_hba.conf file
>usually has a “local postgres postgres peer” (or equivalent) entry which
>lets the DBA become the OS postgres (or whatever user owns the service)
>user and then just connect to the cluster using the postgres role.
>Regardless, your ability to becomes superuser depends at this point on
>being able to become the OS user that owns the PostgreSQL service so you
>can modify pg_hba.conf to let you login.
>
>David J.


view thread (4+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: How to make superuser from non superuser in PostgreSQL
  In-Reply-To: <[email protected]>

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

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