Prettification versus dump safety - Mailing list pgsql-hackers

From Tom Lane
Subject Prettification versus dump safety
Date
Msg-id 27259.1258736049@sss.pgh.pa.us
Whole thread Raw
Responses Re: Prettification versus dump safety
Re: Prettification versus dump safety
List pgsql-hackers
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.

Or somebody could bite the bullet and decouple formatting from
parenthesization decisions in ruleutils.c.  That's not going to be
me, though.

Comments, preferences?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: DEFAULT of domain ignored in plpgsql (8.4.1)
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: plruby code and postgres ?