Re: Fixing pg_dump - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fixing pg_dump
Date
Msg-id 16353.1088389135@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fixing pg_dump  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: Fixing pg_dump
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> We currently fully qualify DROP command with the namespace so that drops 
> will not accidentally modify the system catalogs.  Shouldn't this also 
> be necessary on ALL non-CREATE commands?
> Otherwise, if the create table command associated with each of these 
> fails (for whatever reason), the script could happily carry on and 
> modify the system catalog tables?

I don't buy it.  There's a tradeoff here between certainty of doing what
you want and having a script that is easy to edit.  DROP is a dangerous
weapon and we should be circumspect about applying it, but ALTER OWNER
etc are much less so.

Also, the point about qualifying the DROP is that you do not know
whether the object is there initially, and so you could be dropping
the wrong thing even in non-error cases.  The scenario where the CREATE
fails is much less probable.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fixing pg_dump
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Fixing pg_dump