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

Поиск
Список
Период
Сортировка
От Gavin Flower
Тема Re: Problems with question marks in operators (JDBC, ECPG, ...)
Дата
Msg-id 555B95A4.9020701@archidevsys.co.nz
обсуждение исходный текст
Ответ на Re: Problems with question marks in operators (JDBC, ECPG, ...)  (Jan de Visser <jan@de-visser.net>)
Ответы Re: Problems with question marks in operators (JDBC, ECPG, ...)  (Kevin Grittner <kgrittn@ymail.com>)
Список pgsql-hackers
On 20/05/15 07:37, Jan de Visser wrote:
> On May 19, 2015 07:04:56 PM Greg Sabino Mullane wrote:
>> Bruno Harbulot asked for a devil's advocate by saying:
>>> My main point was that this is not specific to JDBC. Considering that even
>>> PostgreSQL's own ECPG is affected, the issue goes probably deeper than it
>>> seems. I'm just not convinced that passing the problem onto connectors,
>>> libraries and ultimately application developers is the right thing to do
>>> here.
>> 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?
>
> 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.
>
> jan
>
>
>
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 '$'?



Cheers,
Gavin



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jan de Visser
Дата:
Сообщение: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Следующее
От: Geoff Winkless
Дата:
Сообщение: Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint