public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chapman Flack <[email protected]>
Subject: Re: [Pljava-dev] conditional SQL in DDR, and a testing idea
Date: Sat, 10 Oct 2015 17:38:13 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

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/examp...

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
[email protected]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev



view thread (4+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [Pljava-dev] conditional SQL in DDR, and a testing idea
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox