Re: [Pljava-dev] conditional SQL in DDR, and a testing idea

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To:
Subject: Re: [Pljava-dev] conditional SQL in DDR, and a testing idea
Date: 2015-10-10 21:38:13
Message-ID: 56198545.802@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

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(at)lists(dot)pgfoundry(dot)org
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Chapman Flack 2015-10-10 21:38:24 Re: [Pljava-dev] PL/java kills unicode chars?
Previous Message Chapman Flack 2015-10-06 15:05:18 [Pljava-dev] (sorry for noise) pljava-dev delivery test