Re: Problems with question marks in operators (JDBC, ECPG, ...)

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date: 2015-05-19 21:31:32
Message-ID: ca4b8807bb9acf1bb22162193cce120a@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Jan de Visser wrote:
>> Well, one could argue that it *is* their problem, as they should be using
>> the standard Postgres way for placeholders, which is $1, $2, $3...

> Shirley you are joking: Many products use JDBC as an abstraction layer
> facilitating (mostly) seamless switching between databases. I know the product
> I worked on did. Are you advocating that every single statement should use
> "SELECT * FROM foo WHERE bar = $1" on pg and "SELECT * FROM foo WHERE bar = ?"
> on every other database?

I'm not joking, and don't call me Shirley. If you are running into situations
where you have question mark operators in your queries, you have already lost
the query abstraction battle. There will be no seamless switching if you
are using jsonb, hstore, ltree, etc. My statement was more about pointing out
that Postgres already offers a complete placeholder system, which drivers
are free to implement if they want.

> A database is only as valuable as the the part of the outside world it can
> interact with. Large parts of the data-consuming world are developed in java
> using JDBC. If your opinion is that JDBC developers should adapt themselves to
> pg then you instantaneously diminish the value of pg.

Well, they will have to adapt to one way or another: using ?? or \? is doing
so, and the other solution (Postgres adapting itself to the driver by
deprecating the ? operator) is not realistically likely to happen.

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201505191718
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAlVbq4AACgkQvJuQZxSWSsgrXgCaA6MTvbDeg2aMf+/HFnxutrqH
P1sAoLZB1w5+UXHMxXqW/Ex0q7GwoFds
=IOpS
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Harbulot 2015-05-19 21:34:05 Re: Problems with question marks in operators (JDBC, ECPG, ...)
Previous Message Joshua D. Drake 2015-05-19 21:30:42 Rewriting backup.sgml (patch attached)