Re: all postgres users do "not exist"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Will Cameron <novawcameron(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: all postgres users do "not exist"
Date: 2006-11-16 18:24:35
Message-ID: 19722.1163701475@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Will Cameron <novawcameron(at)yahoo(dot)com> writes:
> I'm not sure what exactly you mean by "starting a standalone postgres
> session and using it to recreate your SQL users". Do you mean running
> initdb on a new data directory and then trying to create new users?

No, I mean stopping the postmaster, running a stand-alone backend as
documented in
http://www.postgresql.org/docs/8.0/static/app-postgres.html
and issuing a CREATE USER command for each account you find is missing
from pg_shadow. You could probably just recreate the postgres superuser
this way, and then go back to normal operating mode for the rest of the
recovery.

Note you'll want to use the SYSID option of CREATE USER to make sure
the users are recreated with the same pg_shadow.usesysid they had
before, else their owned objects will not be correctly linked to them.
Look into the owner columns of pg_class etc to determine the values you
need.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Naz Gassiep 2006-11-16 19:12:50 Re: replication?
Previous Message Mark Steben 2006-11-16 18:13:38 Re: Question on partitioning