-
Notifications
You must be signed in to change notification settings - Fork 913
Closed
Description
Describe the issue
The return of CallableStatement#getUpdateCount() is 0 when calling a PostgreSQL stored procedure, which seems wrong since lots of other databases/drivers return -1.
Driver Version?
42.6.2
Java Version?
17
OS Version?
Windows/Linux
PostgreSQL Version?
16.1-1
To Reproduce
See code
Expected behaviour
Return an update count of -1.
Logs
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Properties;
public class TestNullsFirst {
public static void main(String []args) throws Exception {
String url = "jdbc:postgresql://localhost:5432/test";
Properties props = new Properties();
props.setProperty("user", "test");
props.setProperty("password", "test");
try ( Connection conn = DriverManager.getConnection(url, props) ){
try ( Statement statement = conn.prepareStatement() ) {
statement.execute( "create table emps (id int not null primary key, name text)");
statement.execute( "create procedure DeleteAllEmp() language 'plpgsql' as ' begin delete from emps where name is null; END ;'");
}
try ( CallableStatement statement = conn.prepareCall("{call DeleteAllEmp()}") ) {
statement.execute();
System.out.println( "UpdateCount: " + statement.getUpdateCount() );
}
}
}
}Metadata
Metadata
Assignees
Labels
No labels