pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Non existent user error on restore
2+ messages / 2 participants
[nested] [flat]

* Non existent user error on restore
@ 2004-06-23 15:03  Werner Bohl <wbohl@deepdata.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Werner Bohl @ 2004-06-23 15:03 UTC (permalink / raw)
  To: pgsql-admin

I'm using Postgresql 7.4.2 on RedHat 9. We backup a database weekly with
the following command:

pg_dump --clean --create  --verbose --format=c \
   --compress 9 -U admin $DBSID \
    | dbdumpsplit $DBSID.dump

where $DBSID is the database name. The database is very large, so we
split the dump in 1GB chunks.

Created a new database to hold a copy of the backup. Then issued 
  cat $DBSID.dump* | pg_restore -d NEW_DB
This errs with following message:
pg_restore: [archiver (db)] could not execute query: ERROR: user "100"
does not exist

Issuing a \du does not list a user with name or id 100 on the backed-up
database. Created a user with:
  createuser -i 100 dropme
Run the restore again, but gave same error!

Tried to drop the user:
  dropuser dropme
and it returned an error saying that user dropme owned a database and
could not be dropped.

Please help me cause I'm really baffled with this odd behavior.

-- 
Werner Bohl <wbohl@deepdata.com>
Infutor de Costa Rica




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Non existent user error on restore
@ 2004-06-23 15:43  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Werner Bohl <wbohl@deepdata.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-06-23 15:43 UTC (permalink / raw)
  To: wbohl@deepdata.com; +Cc: 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-06-23 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-23 15:03 Non existent user error on restore Werner Bohl <wbohl@deepdata.com>
2004-06-23 15:43 ` Tom Lane <tgl@sss.pgh.pa.us>

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