Prettification versus dump safety

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Prettification versus dump safety
Date: 2009-11-20 16:54:09
Message-ID: 27259.1258736049@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2009-11-20 17:29:15 Re: Summary and Plan for Hot Standby
Previous Message Robert Haas 2009-11-20 16:37:40 Re: DEFAULT of domain ignored in plpgsql (8.4.1)