Re: I need to know password for postgres

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Robertson <david(at)robertsonphoto(dot)fsnet(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: I need to know password for postgres
Date: 2002-08-13 21:35:03
Message-ID: 1446.1029274503@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

David Robertson <david(at)robertsonphoto(dot)fsnet(dot)co(dot)uk> writes:
> 1. login as postgres - which I can only do by su and then su postgres.
> 2. createdb - no problem
> 3. launch gphotocoll as postgres. I have to supply the password for
> postgres and I don't know it.

If you are the postgres OS user then you can force your way in anyway.
Temporarily change $PGDATA/pg_hba.conf to allow "trust" login, then
connect to the database with psql, then use ALTER USER command to
set the database password for postgres to whatever you want. Then
you can revert pg_hba.conf to a less insecure setting. (Or read the
admin guide and work out what connection security policy suits your
needs. On a single-user box, "trust" might be perfectly okay.)

BTW, I'd suggest creating an unprivileged database user for gphotocoll
to run as. If you don't run gphotocoll as Linux root, you probably
shouldn't run it as a database superuser either.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Oliver Elphick 2002-08-13 21:40:11 Re: I need to know password for postgres
Previous Message Oliver Elphick 2002-08-13 21:23:29 Re: Newbie trying to load table with data...