Re: IN clauses via setObject(Collection) [Was: Re: Prepared

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
Cc: "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: IN clauses via setObject(Collection) [Was: Re: Prepared
Date: 2003-07-22 12:59:06
Message-ID: 3F1D351A.8070807@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Paul Thomas wrote:
>
> On 21/07/2003 18:51 Fernando Nasser wrote:
>
>> Also, we may limit this behavior with Collections to the IN clause
>> only. Where else could we need lists to replace the '?' ?
>
>
> Nowhere. Not even with an IN clause. If the programmer needs
> IN(1,2,3,4,5) then he must write IN(?,?,?,?,?) in his prepare string.
> That's the way JDBC works. Period. Acceptance of any other behaviour is
> un-professional and against the standards. As you said yourself, neither
> Oracle nor DB2 support this behavior. Neither should PostgreSQL.
>

Well, I was just informed that the 7.4 backend supports an IN list which
is filled with a PostgreSQL array. As the syntax requires the
parenthesis to be in place (it only fills the list itself) there is no
ambiguity.

Its support is limited on 7.4 (the optimized is not aware of it and
generates a crappy plan) but one may consider improving it for 7.5.

--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Fernando Nasser 2003-07-22 13:05:45 Re: the IN clause saga
Previous Message Felipe Schnack 2003-07-22 12:08:23 Re: IN clauses via setObject(Collection) [Was: Re: Prepared