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

Issue with batch update and timestamp escape syntax error

From: "Hui Ye" <Hui(dot)Ye(at)STELLENT(dot)COM>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Issue with batch update and timestamp escape syntax error
Date: 2007-07-26 19:40:59
Message-ID: DA24D0BCC2F3F845B1680D7F4E2790E002329D29@mail2.intranetsolutions.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hi, folks,

We run into an issue on update query with timestamp in batch execution.
It appears that following query triggers complaints about "syntax error
at or about '{'".
UPDATE testtable SET time = {ts '2007-07-26 10:11:12'} where id = 1;

The same time stamp escape sequence worked fine as part of where clause
in SELECT query and as values in INSERT query.

What we do essentially is the following:
stmt.addBatch("UPDATE testtable SET time={ts '2007-07-26 10:11:12'}
WHERE id = 1");
stmt.addBatch(....);
...
stmt.executeBatch();

An exception is thrown from executeBatch() call with the complaint of
syntax error.

It appeared that timestamp value is not converted properly before the
query was sent to the database. We have confirmed the issue with
following systems:
Driver 8.2.504 and Postgresql 8.1.4
Driver 8.2.505 and Postgresql 8.2.4

Could this issue be verified and fixed?

Thanks much.

Hui

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2007-07-27 08:56:51
Subject: Re: Clean up wasNullFlag usage
Previous:From: Mark LewisDate: 2007-07-26 16:42:22
Subject: Re: how to handle very large data object efficiently

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group