pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
backwards compatibility problem
2+ messages / 2 participants
[nested] [flat]

* backwards compatibility problem
@ 2006-05-10 16:27 Csaba Nagy <nagy@ecircle-ag.com>
  2006-05-10 17:40 ` Re: backwards compatibility problem Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Csaba Nagy @ 2006-05-10 16:27 UTC (permalink / raw)
  To: pgsql-jdbc

Hi all,

I was trying to upgrade the postgres JDBC driver I was using due to the
fix for supporting high-unicode characters.
I was using before the file:
postgresql-8.1dev-400.jdbc3.jar
and upgraded to:
postgresql-8.1-405.jdbc3.jar

The new one fixes indeed the high-unicode character support, but it
breaks other code we have...

Specifically, with the former driver the following query would work:

select ? - '1 day'::interval

where the parameter is set to a timestamp value (either via setTimestamp
or setObject without specifying the type, the result is the same).

With the new driver the same code results in:
ERROR: invalid input syntax for type interval: "2006-05-10
18:15:47.679000 +0200"

Casting the ? sign to timestamp in the query works here (tested), but I
wonder why this was working in the older driver and stopped working with
the newer. AFAIK the protocol did not change and strict typing was
required already with the old driver, so how come that got it right and
the new one does not ?

Thanks,
Csaba.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: backwards compatibility problem
  2006-05-10 16:27 backwards compatibility problem Csaba Nagy <nagy@ecircle-ag.com>
@ 2006-05-10 17:40 ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2006-05-10 17:40 UTC (permalink / raw)
  To: Csaba Nagy <nagy@ecircle-ag.com>; +Cc: pgsql-jdbc



On Wed, 10 May 2006, Csaba Nagy wrote:

> Hi all,
>
> I was trying to upgrade the postgres JDBC driver I was using due to the
> fix for supporting high-unicode characters.
> I was using before the file:
> postgresql-8.1dev-400.jdbc3.jar
> and upgraded to:
> postgresql-8.1-405.jdbc3.jar
>
> The new one fixes indeed the high-unicode character support, but it
> breaks other code we have...
>
> Specifically, with the former driver the following query would work:
>
> select ? - '1 day'::interval
>
> where the parameter is set to a timestamp value (either via setTimestamp
> or setObject without specifying the type, the result is the same).
>
> With the new driver the same code results in:
> ERROR: invalid input syntax for type interval: "2006-05-10
> 18:15:47.679000 +0200"
>
> Casting the ? sign to timestamp in the query works here (tested), but I
> wonder why this was working in the older driver and stopped working with
> the newer. AFAIK the protocol did not change and strict typing was
> required already with the old driver, so how come that got it right and
> the new one does not ?
>

The older driver did not correctly handle calling setTimestamp when 
inserting into a timestamp without time zone column because the 
setTimestamp call used the timestamp with time zone type.  The newer 
driver version passes an unknown type and lets the server figure out what 
it is.  In this case it incorrectly guesses interval.  Unfortunately there 
is no way to hint to the server that we know it's a timestamp type, but we 
don't know which variety.

Kris Jurka




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-05-10 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-10 16:27 backwards compatibility problem Csaba Nagy <nagy@ecircle-ag.com>
2006-05-10 17:40 ` Kris Jurka <books@ejurka.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox