Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YbwTR-0006Mq-P3 for pgsql-bugs@arkaria.postgresql.org; Sat, 28 Mar 2015 19:32:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YbwTR-00055E-7c for pgsql-bugs@arkaria.postgresql.org; Sat, 28 Mar 2015 19:32:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YbwTP-000555-8L for pgsql-bugs@postgresql.org; Sat, 28 Mar 2015 19:32:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YbwTG-0001Uy-7U for pgsql-bugs@postgresql.org; Sat, 28 Mar 2015 19:32:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t2SJWRUf014803; Sat, 28 Mar 2015 15:32:27 -0400 From: Tom Lane To: Jon Jensen cc: Jeff Davis , pgsql-bugs@postgresql.org Subject: Re: pg_get_constraintdef() doesn't always give an equal constraint In-reply-to: References: <19820.1427153553@sss.pgh.pa.us> Comments: In-reply-to Jon Jensen message dated "Fri, 27 Mar 2015 16:41:08 -0400" Date: Sat, 28 Mar 2015 15:32:27 -0400 Message-ID: <14802.1427571147@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Jon Jensen 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs