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

From: Jan de Visser <jan(at)de-visser(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date: 2015-05-19 23:18:17
Message-ID: 3590664.B1k1gKd50H@bison
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On May 19, 2015 09:31:32 PM Greg Sabino Mullane wrote:
> 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.

I must have misunderstood you <strike>Shirley</strike> Greg, because to me it
parsed as if you were suggesting (paraphrasing) "ah forget about those pesky
standardized drivers and their pesky syntax requirements. Just use ours like a
big boy".

I understand that once you start using '?' as (part of) operator names in your
queries you're not portable anymore. I just thought that your proposed
solution was to throw all portability out the window. But I was probably
(hopefully?) wrong.

jan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2015-05-19 23:23:13 Re: Change pg_cancel_*() to ignore current backend
Previous Message Jim Nasby 2015-05-19 23:13:45 Re: Making the regression tests halt to attach a debugger