pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #5948: JDBC wrond insert of timestamp data
2+ messages / 2 participants
[nested] [flat]

* BUG #5948: JDBC wrond insert of timestamp data
@ 2011-03-25 10:58 yuriy.tereschuk <astro@evernet.lutsk.ua>
  2011-03-25 15:00 ` Re: BUG #5948: JDBC wrond insert of timestamp data Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 2+ messages in thread

From: yuriy.tereschuk @ 2011-03-25 10:58 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      5948
Logged by:          yuriy.tereschuk
Email address:      astro@evernet.lutsk.ua
PostgreSQL version: postgresql90
Operating system:   Linux Fedora 14
Description:        JDBC wrond insert of timestamp data
Details: 

org.postgresql.util.PSQLException: ERROR: column "datetime" is of type
timestamp without time zone but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.

JDBC version postgresql90-jdbc-9.0.801-1PGDG.f14.i686



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

* Re: BUG #5948: JDBC wrond insert of timestamp data
  2011-03-25 10:58 BUG #5948: JDBC wrond insert of timestamp data yuriy.tereschuk <astro@evernet.lutsk.ua>
@ 2011-03-25 15:00 ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2011-03-25 15:00 UTC (permalink / raw)
  To: yuriy.tereschuk <astro@evernet.lutsk.ua>; +Cc: pgsql-bugs



On Fri, 25 Mar 2011, yuriy.tereschuk wrote:

>
> The following bug has been logged online:
>
> Bug reference:      5948
> PostgreSQL version: postgresql90
> Operating system:   Linux Fedora 14
> Description:        JDBC wrond insert of timestamp data
> Details:
>
> org.postgresql.util.PSQLException: ERROR: column "datetime" is of type
> timestamp without time zone but expression is of type character varying
>  Hint: You will need to rewrite or cast the expression.
>
> JDBC version postgresql90-jdbc-9.0.801-1PGDG.f14.i686
>

You are most likely setting the timestamp value by using setString or 
setObject with a string value on a PreparedStatement.  This is indicating 
to the driver that you want the parameter to have a string (varchar) type. 
This is not correct for a timestamp.  You should use setTimestamp or 
setObject with a third parameter indicating that the value is a timestamp. 
If you are unable to change your application for some reason, you can 
adjust the driver's binding behavior by using the stringtype=unspecified 
connection parameter described here:

http://jdbc.postgresql.org/documentation/84/connect.html#connection-parameters

Kris Jurka



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


end of thread, other threads:[~2011-03-25 15:00 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25 10:58 BUG #5948: JDBC wrond insert of timestamp data yuriy.tereschuk <astro@evernet.lutsk.ua>
2011-03-25 15:00 ` 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