Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist

From: Dave Rolsky <autarch(at)urth(dot)org>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist
Date: 2013-02-15 22:06:12
Message-ID: alpine.DEB.2.00.1302151604450.13270@urth.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Fri, 15 Feb 2013, Bruce Momjian wrote:

> On Wed, Feb 13, 2013 at 08:22:43PM +0000, autarch(at)urth(dot)org wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference: 7873
>> Logged by: Dave Rolsky
>> Email address: autarch(at)urth(dot)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.

Cheers,

-dave

/*============================================================
http://VegGuide.org http://blog.urth.org
Your guide to all that's veg House Absolute(ly Pointless)
============================================================*/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-02-15 22:14:53 Re: BUG #7886: date_trunc(date) returning timestamptz instead of timestamp
Previous Message Tom Lane 2013-02-15 22:02:46 Re: BUG #7885: postmaster panic on startup does not release shared memory

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniele Varrazzo 2013-02-15 23:11:40 Re: [RFC] ideas for a new Python DBAPI driver (was Re: libpq test suite)
Previous Message Peter Eisentraut 2013-02-15 21:28:05 Re: [RFC] ideas for a new Python DBAPI driver (was Re: libpq test suite)