In the provided test case, a CREATE TABLE SQL statement is executed using stmt.executeUpdate(createTableSql, Statement.RETURN_GENERATED_KEYS). This execution unexpectedly results in a syntax error: "syntax error at or near 'RETURNING'".
This behavior is inconsistent with Postgres JDBC.
@Test
public void test() {
try (Connection con = DriverManager.getConnection("jdbc:pgsql://localhost:5432/test0", "user", "password")) {
Statement stmt = con.createStatement();
String createTableSql = "CREATE TABLE table0_0(id INT PRIMARY KEY, value VARCHAR(5));";
stmt.executeUpdate(createTableSql, Statement.RETURN_GENERATED_KEYS);
} catch (SQLException e) {
e.printStackTrace(); // syntax error at or near "RETURNING"
}
}
In the provided test case, a CREATE TABLE SQL statement is executed using stmt.executeUpdate(createTableSql, Statement.RETURN_GENERATED_KEYS). This execution unexpectedly results in a syntax error: "syntax error at or near 'RETURNING'". This behavior is inconsistent with Postgres JDBC.