forked from abevoelker/do
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed problem with Postgres 9.1 Writeable CTE's
Problem solved by rewriting code that checked whether the query should be executed using PreparedStatement#executeQuery() or using PreparedStatement#executeUpdate(). Original code checked for the existence of the word 'RETURNING', where this is perfectly possible in Postgres 9.1, where a writable CTE can be created with the word RETURNING in it, while not actually returning any values (i.e. #executeQuery() should have been called) Fix is to use the PreparedStatement#execute(), which returns a boolean that indicates whether a result was returned, or that existing rows were affected. Based on the value of this boolean either a ResultSet is requested or the number of affected rows is retrieved.
- Loading branch information
1 parent
8a53915
commit 1a974de
Showing
2 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters