Re: Non existent user error on restore - Mailing list pgsql-admin

From Tom Lane
Subject Re: Non existent user error on restore
Date
Msg-id 2866.1088005385@sss.pgh.pa.us
Whole thread Raw
In response to Non existent user error on restore  (Werner Bohl <wbohl@deepdata.com>)
List pgsql-admin
Werner Bohl <wbohl@deepdata.com> writes:
> pg_restore: [archiver (db)] could not execute query: ERROR: user "100"
> does not exist

I'd suggest doing a plain text schema-only dump (pg_dump -s) and looking
through it for references to userid 100.  You have presumably got some
objects in the database that are owned by a now-gone user.  Fixing their
ownership would be the best long-term solution.

> Created a user with:
>   createuser -i 100 dropme
> Run the restore again, but gave same error!

I think you'd actually need "createuser 100", ie, the name not the sysid
is what's being complained of above.  It might be prudent to give it
sysid 100 as well, though.

            regards, tom lane

pgsql-admin by date:

Previous
From: Werner Bohl
Date:
Subject: Non existent user error on restore
Next
From: Tom Lane
Date:
Subject: Re: Asunto: Re: Problems restoring a DB with oids