> org.postgresql.util.PSQLException: Too many update results were returned.
At a guess maybe you are adding statements to the batch that are
actually semicolon-separated statements? I don't know if the batch code
understands that.
-O
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
note: if i use a simple executeUpdate for multiple inserts that are
semicolon-separated, than they work.
albertlr
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at
> yes, the statements are semicolon-separated. than you have some idea how
> to make it to work?
Try adding only one statement per addBatch() i.e. instead of
stmt.addBatch("insert a; insert b; insert c");
do:
stmt.addBatch("insert a");
stmt.addBatch("insert b");
stmt.addBatch("insert c");
> note: if i use a simple executeUpdate for multiple inserts that are
> semicolon-separated, than they work.
Yes, executeUpdate is a different code path that does understand
semicolon-separated paths.
The batch code expects exactly one command status per addBatch(). It's
not clear from the JDBC API what you're meant to do with an addBatch()
call that returns more than one thing, since executeBatch() is meant to
return one array element (representing the update status) per addBatch()
call AFAIK.
-O
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
> semicolon-separated paths.
err, statements not paths (I need more coffee)
-O
---------------------------(end of broadcast)---------------------------
exists some software that can extract these statements?
>
>> note: if i use a simple executeUpdate for multiple inserts that are
>> semicolon-separated, than they work.
>
> Yes, executeUpdate is a different code path that does understand
> semicolon-separated paths.
>
> The batch code expects exactly one command status per addBatch(). It's
> not clear from the JDBC API what you're meant to do with an addBatch()
> call that returns more than one thing, since executeBatch() is meant
> to return one array element (representing the update status) per
> addBatch() call AFAIK.
>
> -O
>
albertlr
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majo...@postgresql.org so that your
message can get through to the mailing list cleanly
> i wish i can do that. the files that contains those statements are up to
> 500k ... and the majority of the code contain function implementations.
Err ok if you're just reading from a file and giving it to the driver
without any (or little) parsing, why exactly are you using batch updates
in the first place? Can't you just use plain execute()?
-O
these files are upgrades from a database, but must be run on more than
600 databases.
albertlr
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
If you're getting a syntax error on execute() then using executeBatch()
is not going to help you since executeBatch() is really just an
optimized special case of execute() .. I think you should be
investigating this syntax error first of all.
-O
> org.postgresql.util.PSQLException: ERROR: unterminated dollar-quoted
> string at or near "$BODY$
What driver version are you using?
org.postgresql.util.PSQLException: ERROR: unterminated dollar-quoted
string at or near "$BODY$
DECLARE
vID INTEGER"
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:339)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:331)
this is the starting part of a function declaration.
albertlr
---------------------------(end of broadcast)---------------------------
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Support for dollar-quoting was only introduced in 8.2-504, you will need
to upgrade your driver.
-O
---------------------------(end of broadcast)---------------------------
thanks again for the help
albertlr
---------------------------(end of broadcast)---------------------------
in the mean while i try to figure it out how the development team of the
SQuirreL use the sql execution tool in that client.
albertlr
---------------------------(end of broadcast)---------------------------