Message-ID: <56198545.802@anastigmatix.net> Date: Sat, 10 Oct 2015 17:38:13 -0400 From: Chapman Flack MIME-Version: 1.0 References: <55FEBCFA.8060502@anastigmatix.net> In-Reply-To: <55FEBCFA.8060502@anastigmatix.net> Subject: Re: [Pljava-dev] conditional SQL in DDR, and a testing idea Content-Type: text/plain; charset="us-ascii" Chapman Flack wrote: > Some code in an untagged part of the DDR could do: > > SELECT CASE WHEN check_for_93() > THEN SET LOCAL pljava.implementortags TO ...append PostgreSQL-9.3... > END > > adding PostgreSQL-9.3 to the list, and if SQLDeploymentDescriptor.install > rechecks the variable after each command, then from that point it would > include all commands tagged > > BEGIN PostgreSQL-9.3 > ... stuff ... > END PostgreSQL-9.3 > > and as you could make up any arbitrary tags, you could test for and > enable BEGIN PostgreSQL-with-feature-X ... > or bug-Y or whatever made sense in your case. This first installment (i.e. just conditional execution, no pgTap integration yet) is now merged to the master branch. There's a new example that demonstrates it: https://github.com/tada/pljava/blob/master/pljava-examples/src/main/java/org/postgresql/pljava/example/annotation/UnicodeRoundTripTest.java It wraps a test query up in BEGIN postgresql9_0plus...END postgresql9_0plus (and enables that tag in the way you'd expect) to avoid running the query on pre-9.0 systems that don't accept the syntax. -Chap _______________________________________________ Pljava-dev mailing list Pljava-dev@lists.pgfoundry.org http://lists.pgfoundry.org/mailman/listinfo/pljava-dev