Thanks Stephen.
Here's my take on pre-processing approach:
https://github.com/pgjdbc/pgjdbc/pull/435
It seems to compile and pass the tests. "release procedure" is to be
checked (set of generated artifacts, naming, versions, etc).
Here's how a section is made "optional for jdbc 4.2 only":
https://github.com/pgjdbc/pgjdbc/blob/2069770c95632118b76fa2fc9229c2f3666e46f4/src/main/java/org/postgresql/jdbc/PgResultSet.java#L304-L320
Vladimir