Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U6UzM-00015n-B1 for pgsql-bugs@arkaria.postgresql.org; Fri, 15 Feb 2013 23:46:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U6UzL-0005vC-Lk for pgsql-bugs@arkaria.postgresql.org; Fri, 15 Feb 2013 23:46:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U6UzK-0005v6-Rd for pgsql-bugs@postgresql.org; Fri, 15 Feb 2013 23:46:42 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U6UzG-0001eK-Ph for pgsql-bugs@postgresql.org; Fri, 15 Feb 2013 23:46:42 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1U6UzF-0007tA-3v; Fri, 15 Feb 2013 18:46:37 -0500 Date: Fri, 15 Feb 2013 18:46:37 -0500 From: Bruce Momjian To: Dave Rolsky Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist Message-ID: <20130215234637.GH12030@momjian.us> References: <20130215203205.GC12030@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Fri, Feb 15, 2013 at 04:06:12PM -0600, Dave Rolsky wrote: > On Fri, 15 Feb 2013, Bruce Momjian wrote: > > >On Wed, Feb 13, 2013 at 08:22:43PM +0000, autarch@urth.org wrote: > >>The following bug has been logged on the website: > >> > >>Bug reference: 7873 > >>Logged by: Dave Rolsky > >>Email address: autarch@urth.org > >>PostgreSQL version: 9.2.3 > >>Operating system: Linux > >>Description: > >> > >>When you pass the --clean option to pg_restore it tries to drop tables > >>without checking if they exist. This results in lots of error output. If > >>you're running pg_restore via an automated process it's very hard to > >>distinguish between these "ok" errors and real errors. > >> > >>It should be using "DROP TABLE IF EXISTS" and the equivalent for > >>constraints. > > > >Well, I think the question is whether you want error feedback for things > >that don't exist. I don't really know the answer. > > Fair enough. It should probably an option to add "if exists", at > least. I can't imagine I'm the only using this tool to ship database > updates around to different machines, some of which may not have new > tables. I'd really like to be able to know when the restore fails > versus when it succeeds but is noisy. All I can say is I don't remember anyone asking for this in the past. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs