Re: why not type casting by default in prepared statements?

From: Harald Krake <harald(at)krake(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: why not type casting by default in prepared statements?
Date: 2002-11-16 18:23:01
Message-ID: 200211161923.01447.harald@krake.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Saturday 16 November 2002 05:20 pm, Tom Lane wrote:
> This has been suggested, and rejected, repeatedly.

ah!
Sorry for the post. Obviously I used the wrong patterns
searching through the archives.

> It's not a good idea to apply a driver-side band-aid to mask a
> server-side problem;

agreed.

> In other words, any driver-side solution
> will fix some queries and break others.

imho it will only break queries written by "postgres-aware" programmers.
I suppose, most of the java/jdbc code written for other
databases does not contain any casts (in prepared statements) because
the programmers leave that up to the server backend and/or the driver.
And if you look at setString(), even the postgres driver casts, respectively
quotes.
What happens if someone tries to move from XY-DB to postgres --
like me -- is that postgres performs very bad compared to XY-DB und thus
might be considered as slow, which it isn't. In my case postgres now
outperforms the former commercial database significantly (approx. 3-5
times faster!).

> There will be a real solution in the backend someday soon, perhaps 7.4.

until then, what about a switch, for instance as an option to the url,
for those who don't want to change their code? (like me ;-)

regards,
harald.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message snpe 2002-11-16 19:57:29 Query for DatabaseMetaData.getImportedKey
Previous Message Tom Lane 2002-11-16 16:20:14 Re: why not type casting by default in prepared statements?