Re: How to pg_dumpall without root password

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dat Chu <dattanchu(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to pg_dumpall without root password
Date: 2007-07-13 01:43:40
Message-ID: 9113.1184291020@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dat Chu <dattanchu(at)gmail(dot)com> writes:
> I am the new sysadmin and was given the task to move a postgresql
> installation from one box to another. So I want to do pg_dumpall .

> However, there is no record of postgresql superuser/root password. I
> do have root access to the system however.

Edit pg_hba.conf to allow local "trust" access. SIGHUP or restart
postmaster. Connect as postgres user and set password as you see fit.
Restore the previous pg_hba.conf settings (and SIGHUP again).

If you're worried about having the system insecure even transiently
against local bad guys, it's possible to do this without opening any
hole, but it requires taking the DB down for a few minutes so you can
do the password change in standalone mode.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-07-13 01:46:03 Re: question on scan of clustered index
Previous Message Tom Lane 2007-07-13 01:39:07 Re: optimizing postgres