Re: Prettification versus dump safety

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Prettification versus dump safety
Date: 2009-11-20 18:38:49
Message-ID: 4B06E239.7040808@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2009-11-20 19:15:46 Re: Summary and Plan for Hot Standby
Previous Message Greg Sabino Mullane 2009-11-20 18:16:03 Re: Prettification versus dump safety