Re: pg_get_constraintdef() doesn't always give an equal constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jon Jensen <jon(at)endpoint(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: pg_get_constraintdef() doesn't always give an equal constraint
Date: 2015-03-28 19:32:27
Message-ID: 14802.1427571147@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jon Jensen <jon(at)endpoint(dot)com> writes:
> On Mon, 23 Mar 2015, Tom Lane wrote:
>> A larger issue is that I have a nasty feeling that this isn't the
>> only place where ruleutils.c output might be read in a way that's
>> functionally equivalent to the original, but not the exact same
>> parsetree.

> Jeff pointed this out to me and as we discussed it, it seems like a good
> time to add a regression test to make us aware of the current parse +
> deparse behavior, and call attention to any changes in that behavior
> later.

> Attached is a Perl script that generates many combinations of CHECK
> constraints like Jeff's, but with various types, and the result of running
> it in the regression test suite.

> Would something like this be welcome in the regression test suite?

I can't really see adding something like this to the regression tests;
the value per cycle expended, over the long term, just isn't there IMO.

We could possibly use this approach as a one-shot test for vetting a
proposed patch ... but as you've got it set up, it seems like it requires
manual inspection of each output to see if it's OK or not, which isn't
all that helpful. I wonder whether there isn't a more direct way of
testing whether each output re-parses to the same node tree.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jon Jensen 2015-03-28 23:18:19 Re: pg_get_constraintdef() doesn't always give an equal constraint
Previous Message Tom Lane 2015-03-28 19:08:16 Re: pg_get_constraintdef() doesn't always give an equal constraint