Multiple semicolon separated statements and autocommit
От | Rene Pijlman |
---|---|
Тема | Multiple semicolon separated statements and autocommit |
Дата | |
Msg-id | cbqqotcde1c6s8c58nk26ui4et27agdqrq@4ax.com обсуждение исходный текст |
Ответы |
Re: Multiple semicolon separated statements and autocommit
|
Список | pgsql-hackers |
We're discussing an implementation of JDBC's Statement.executeBatch() on the pgsql-jdbc list. The idea is to send multiple semicolon separated statements in one call to the backend. The purpose of this feature is of course a performance improvement, since it executes multiple (non-select) statements with one round trip to the server. If autocommit is _enabled_ and S1;S2;S3 is send to the database, what exactly is the behaviour of the backend? For example, what happens if S1 succeeds, S2 fails and S3 would succeed? Does autocommit apply to the statement list send in one call as a whole? Or does it apply to individual statements? If autocommit applies to the list as a whole I assume the failure of S2 would cause the entire statement list to fail and be rolled back. If autocommit applies to individual statements in the list, I assume that S1 succeeds and is committed, S2 fails and is rolled back. But is S3 still executed? And what update count is returned to the client in that case? I will summarize on pgsql-jdbc. Regards, René Pijlman <rene@lab.applinet.nl>
В списке pgsql-hackers по дате отправления: