Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Peter Eisentraut <peter_e@gmx.net>
Date: 2013-12-04T08:56:15Z
Lists: pgsql-bugs, pgsql-hackers
On 2 December 2013 04:55, Pavel Stehule <pavel.stehule@gmail.com> wrote: > Hello > > it looks well, thank you > > Regards > > Pavel > I've been thinking about this some more, and there's another case that concerns me slightly. We're now making some of the DROP...IF EXISTS commands tolerate non-existent types as well as non-existent schemas --- functions, aggregates, casts and operators all have type names in their specifications. Of course it's possible that the type is missing because it was in a schema that was dropped, so this change seems to be in spirit of what was discussed, but it seems like a change that might catch some people out. I think that, on balance, it is a sensible change, since if the type doesn't exist, the dependent object can't exist either, so DROP...IF EXISTS shouldn't be raising an error. However, I wonder if we should be issuing a more specific NOTICE in this case too --- i.e., check for non-existent types in the same way as we check for non-existent parent objects --- type_does_not_exist_skipping() and type_list_does_not_exist_skipping(). Regards, Dean