Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0C8826502AF for ; Thu, 24 Jul 2008 15:01:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 24299-10 for ; Thu, 24 Jul 2008 15:01:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 47C44650217 for ; Thu, 24 Jul 2008 15:01:39 -0300 (ADT) Received: from [192.168.1.5] (or-69-34-217-90.sta.embarqhsd.net [69.34.217.90]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m6OI46MH004024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Jul 2008 11:04:07 -0700 Subject: Re: -O not working From: "Joshua D. Drake" To: Marc Fromm Cc: "pgsql-admin@postgresql.org" In-Reply-To: References: Content-Type: text/plain Organization: Command Prompt, Inc. Date: Thu, 24 Jul 2008 11:01:38 -0700 Message-Id: <1216922498.6858.54.camel@jd-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Thu, 24 Jul 2008 11:04:07 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/208 X-Sequence-Number: 29818 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