Re: Prettification versus dump safety - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: Prettification versus dump safety
Date
Msg-id 4B06E239.7040808@pse-consulting.de
Whole thread Raw
In response to Prettification versus dump safety  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Prettification versus dump safety
List pgsql-hackers
Tom Lane wrote:
> In testing the TRIGGER WHEN patch, I notice that pg_dump is relying on
> pg_get_triggerdef(triggeroid, true) (ie, "pretty" mode) to dump
> triggers.  This means that trigger WHEN conditions will be dumped
> without adequate parenthesization to ensure they are interpreted the
> same way when loaded into future PG versions.  That's not acceptable.
>
> The easy ways out of this are
> (1) change pg_dump to not prettify trigger definitions at all, or
> (2) change pg_get_triggerdef from the submitted patch so that it
> doesn't reduce parenthesization even in "pretty" mode.
>   
The pretty option was explicitely never intended for pg_dump use.
When pg_dump is used to create a future version proof dump, it shouldn't 
use the pretty option, when used to create some schema scripts for 
exernal editing it may be enabled. I propose to invent a cmd line option 
for that (maybe as "prettified plain text" output format).

Regards,
Andreas



pgsql-hackers by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Prettification versus dump safety
Next
From: Heikki Linnakangas
Date:
Subject: Re: Summary and Plan for Hot Standby