Thread: Superuser

Superuser

From
"Reinhard Hnat"
Date:
By mistake I took away superuser rights from my postgresql Admin. Any idea
how to get  it back? There is no other superuser in the database.
----
R.Hnat




Re: Superuser

From
Nabil Sayegh
Date:
Reinhard Hnat wrote:
> By mistake I took away superuser rights from my postgresql Admin. Any idea
> how to get  it back? There is no other superuser in the database.

How did you remove it?
Maybe pg_hba.conf is what you're looking for.
Or the pg_shadow table for passwords etc.

hth
--
  e-Trolley Sayegh & John, Nabil Sayegh
  Tel.: 0700 etrolley /// 0700 38765539
  Fax.: +49 69 8299381-8
  PGP : http://www.e-trolley.de

Re: Superuser

From
Tom Lane
Date:
"Reinhard Hnat" <hnat@logotronic.co.at> writes:
> By mistake I took away superuser rights from my postgresql Admin. Any idea
> how to get  it back? There is no other superuser in the database.

Assuming you are running a reasonably recent Postgres (I am sure this
works in 7.3, don't recall about 7.2 or before):

1. Stop the postmaster.
2. Start a standalone backend (see the "postgres" man page for details).
3. Now you are effectively superuser.  ALTER USER to give your admin
   back superuserness, or just UPDATE his pg_shadow row if that seems
   easier.
4. Stop standalone backend, restart postmaster.

            regards, tom lane