pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Will Cameron <novawcameron@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: all postgres users do "not exist"
Date: Thu, 16 Nov 2006 13:24:35 -0500
Message-ID: <19722.1163701475@sss.pgh.pa.us> (raw)
In-Reply-To: <20061116174050.93090.qmail@web62414.mail.re1.yahoo.com>
References: <20061116174050.93090.qmail@web62414.mail.re1.yahoo.com>

Will Cameron <novawcameron@yahoo.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



view thread (4+ messages)

Message-ID: <19722.1163701475@sss.pgh.pa.us>
Permalink:  ../19722.1163701475@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19722.1163701475@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, novawcameron@yahoo.com
  Subject: Re: all postgres users do "not exist"
  In-Reply-To: <19722.1163701475@sss.pgh.pa.us>
  References: <20061116174050.93090.qmail@web62414.mail.re1.yahoo.com> <19722.1163701475@sss.pgh.pa.us>

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

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