Re: Implicit conversion from string to timestamp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Goodenough <david(dot)goodenough(at)btconnect(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Implicit conversion from string to timestamp
Date: 2006-02-17 15:00:42
Message-ID: 9318.1140188442@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Goodenough <david(dot)goodenough(at)btconnect(dot)com> writes:
> I have some generic code to which I pass a series of values to be inserted
> into a PostgreSQL table which includes a field which is defined as a timestamp
> and which I wish to populate with a string of the form
> "yyyy-MM-dd hh:mm:ss.SSS". Under pg 8 and before this worked fine
> but now with 8.1 I seem to be getting an exception which reads:-

> ERROR: column "created" is of type timestamp without time zone but expression
> is of type character varying

> All this is done using JDBC (so I suppose it might be a JDBC error).

Check the JDBC archives --- I think you're probably getting burnt by
some side effect of the changes they made to use parameterized queries.
You have to be a lot more honest now about informing the JDBC driver
what datatype your statement parameters really are.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Alkins 2006-02-17 16:01:15 Btrieve to SQL
Previous Message Alexander Presber 2006-02-17 14:36:45 Re: TSearch2 / German compound words / UTF-8