pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem with batch insert
3+ messages / 2 participants
[nested] [flat]

* Problem with batch insert
@ 2010-02-18 12:53  zkn <zkn@abv.bg>
  0 siblings, 1 reply; 3+ messages in thread

From: zkn @ 2010-02-18 12:53 UTC (permalink / raw)
  To: pgsql-sql

Hi,

First I'm sorry if this message shouldn't be posted in this mailing list but I wasn't sure if it should be here or in jdbc mailing list.

I have a weird problem with batch insert. It works fine on my development machine but when I upload to the server it fails. Here is the log:

DEBUG [http-8443-2] - {conn-100123} Preparing Statement: insert into target_filters_sections (filter_id, section_id) values (?, ?) , (?, ?) 
DEBUG [http-8443-2] - {pstm-100124} Executing Statement: insert into target_filters_sections (filter_id, section_id) values (?, ?) , (?, ?) 
DEBUG [http-8443-2] - {pstm-100124} Parameters: [23, 229, 23, 141]
DEBUG [http-8443-2] - {pstm-100124} Types: [java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer]
DEBUG [http-8443-2] - Unable to translate SQLException with SQL state '42601', error code '0, will now try the fallback translator
DEBUG [http-8443-2] - Returning JDBC Connection to DataSource
org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: 
--- The error occurred while applying a parameter map. 
--- Check the addSectionsToTargetsFilter-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: org.postgresql.util.PSQLException: ERROR: syntax error at or near ","
Position: 113


And here is the log for the same operation on my development machine:

DEBUG [http-8080-1] - {conn-100006} Preparing Statement: insert into target_filters_sections (filter_id, section_id) values (?, ?) , (?, ?) , (?, ?) 
DEBUG [http-8080-1] - {pstm-100007} Executing Statement: insert into target_filters_sections (filter_id, section_id) values (?, ?) , (?, ?) , (?, ?) 
DEBUG [http-8080-1] - {pstm-100007} Parameters: [28, 1603, 28, 1605, 28, 1604]
DEBUG [http-8080-1] - {pstm-100007} Types: [java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer]
DEBUG [http-8080-1] - Returning JDBC Connection to DataSource

Postgre version on the server 8.1 on development 8.3
Any clues?


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

* Re: Problem with batch insert
@ 2010-02-18 15:32  Tom Lane <tgl@sss.pgh.pa.us>
  parent: zkn <zkn@abv.bg>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2010-02-18 15:32 UTC (permalink / raw)
  To: zkn <zkn@abv.bg>; +Cc: pgsql-sql

zkn <zkn@abv.bg> writes:
> I have a weird problem with batch insert. It works fine on my development machine but when I upload to the server it fails. Here is the log:

> DEBUG [http-8443-2] - {conn-100123} Preparing Statement: insert into target_filters_sections (filter_id, section_id) values (?, ?) , (?, ?) 

> DEBUG [http-8443-2] - Unable to translate SQLException with SQL state '42601', error code '0, will now try the fallback translator

42601 is a syntax error, although I think you ought to complain to
somebody about the fact that your tools don't show you the actual server
error message.

> Postgre version on the server 8.1 on development 8.3

8.1 does not support multiple rows in a VALUES construct.

			regards, tom lane



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

* Re: Problem with batch insert
@ 2010-02-18 16:05  zkn <zkn@abv.bg>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: zkn @ 2010-02-18 16:05 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql


On 18.02.2010, at 17:32, Tom Lane wrote:

> zkn <zkn@abv.bg> writes:
>> I have a weird problem with batch insert. It works fine on my development machine but when I upload to the server it fails. Here is the log:
> 
>> DEBUG [http-8443-2] - {conn-100123} Preparing Statement: insert into target_filters_sections (filter_id, section_id) values (?, ?) , (?, ?) 
> 
>> DEBUG [http-8443-2] - Unable to translate SQLException with SQL state '42601', error code '0, will now try the fallback translator
> 
> 42601 is a syntax error, although I think you ought to complain to
> somebody about the fact that your tools don't show you the actual server
> error message.
> 
>> Postgre version on the server 8.1 on development 8.3
> 
> 8.1 does not support multiple rows in a VALUES construct.

Yes, it was the postgre version.

> 
> 			regards, tom lane
> 
> -- 
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
> 

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


end of thread, other threads:[~2010-02-18 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-02-18 12:53 Problem with batch insert zkn <zkn@abv.bg>
2010-02-18 15:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-02-18 16:05   ` zkn <zkn@abv.bg>

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