Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Sat, 16 Nov 2002 19:23:01 +0100
  • Message-id: <200211161923.01447.harald@krake.de> <text/plain>

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.




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group