Re: Problems with question marks in operators (JDBC, ECPG, ...) - Mailing list pgsql-hackers

From Dave Cramer
Subject Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date
Msg-id CADK3HH+Ts+_WKkpbTKLSg47b_fdwW+mkoN9a3GP0ocYfQdpRiw@mail.gmail.com
Whole thread Raw
In response to Re: Problems with question marks in operators (JDBC, ECPG, ...)  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: Problems with question marks in operators (JDBC, ECPG, ...)
Re: Problems with question marks in operators (JDBC, ECPG, ...)
List pgsql-hackers

On 19 May 2015 at 16:36, Kevin Grittner <kgrittn@ymail.com> wrote:
Gavin Flower <GavinFlower@archidevsys.co.nz> wrote:

> I prefer the $1 approach, others can't use that, and there are
> situations where I could not either.
>
> So, how about defaulting to the '?' approach, but have a method
> to explicitly set the mode - to switch to using '$'?

Are you suggesting that we implement something other than what is
described in these documents for prepared statement parameters?:

http://docs.oracle.com/javase/7/docs/api/java/sql/PreparedStatement.html

http://download.oracle.com/otn-pub/jcp/jdbc-4_1-mrel-spec/jdbc4.1-fr-spec.pdf

If so, I strongly oppose that.  If we are not going to deprecate
use of the question mark character for operators, we need some
nonstandard hack to our JDBC implementation, but an alternative
syntax for specifying PreparedStatement and CallableStatement
parameters seems entirely the wrong way to go.

 
The issue here is what to do about the difficulties in using JDBC
prepared statements in combination with the PostgreSQL extension of
operator names containing question marks.  Using a double question
mark is not horrible as a solution. 

Actually the issue is what to do about a number of connectors which use a fairly standard '?' as a placeholder. 
Notably absent from the discussion is ODBC upon which JDBC was modelled and probably predates any use of ? as an operator

It may not be what we would
have arrived at had the discussion taken place on the pgsql-jdbc
list rather than underneath a github pull request, but we can
only move forward from where we are.

possibly, however all of the current JDBC maintainers opined and reached an agreement on this.
 
Out of curiosity, how long has the ?? solution been implemented in
a driver jar file available as a public download? 

 At least since February of this year

What are the
guidelines for what discussion belongs on the pgsql-jdbc list and
what discussion belongs on github?  Is someone interested in
participating in the discussions leading to decisions about our
JDBC connector expected to follow both?

Currently pull requests are the easiest to deal with so most discussion is on github.

I guess updating the JDBC web page would be in order. 



Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Next
From: Robert Haas
Date:
Subject: Re: a few thoughts on the schedule