pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
-O not working
2+ messages / 2 participants
[nested] [flat]

* -O not working
@ 2008-07-24 17:20  Marc Fromm <Marc.Fromm@wwu.edu>
  0 siblings, 1 reply; 2+ messages in thread

From: Marc Fromm @ 2008-07-24 17:20 UTC (permalink / raw)
  To: pgsql-admin

I backed up all my databases using:
pg_dumpall -O -c -U postgres > /tmp/pgalldb2
-O to remove owners on all objects
-c to drop databases before recreating them during the restore to prevent duplicate records

I restored all the databases with this command
psql -U postgres -f /tmp/pgalldb2 postgres

I tried to drop a user but was denied with the message, ". . . some objects depend on it."

Why isn't the -O flag not removing the owner from all objects?

Thanks

Marc



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

* Re: -O not working
@ 2008-07-24 18:01  Joshua D. Drake <jd@commandprompt.com>
  parent: Marc Fromm <Marc.Fromm@wwu.edu>
  0 siblings, 0 replies; 2+ messages in thread

From: Joshua D. Drake @ 2008-07-24 18:01 UTC (permalink / raw)
  To: Marc Fromm <Marc.Fromm@wwu.edu>; +Cc: pgsql-admin

On Thu, 2008-07-24 at 10:20 -0700, Marc Fromm wrote:
> I backed up all my databases using:
> pg_dumpall -O -c -U postgres > /tmp/pgalldb2
> -O to remove owners on all objects
> -c to drop databases before recreating them during the restore to
> prevent duplicate records
> 
> I restored all the databases with this command
> psql -U postgres -f /tmp/pgalldb2 postgres
> 
> I tried to drop a user but was denied with the message, ". . . some
> objects depend on it."
> 
> Why isn't the -O flag not removing the owner from all objects?

Your problem is likely the -c not the -O. In your target database you
have a role that owns objects. You can't drop a role if it owns objects.

Joshua D. Drake

> 
> Marc
> 
-- 
The PostgreSQL Company since 1997: http://www.commandprompt.com/ 
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate






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


end of thread, other threads:[~2008-07-24 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-07-24 17:20 -O not working Marc Fromm <Marc.Fromm@wwu.edu>
2008-07-24 18:01 ` Joshua D. Drake <jd@commandprompt.com>

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