unquote table/column names when inferring sequence name on postgres

This commit is contained in:
Gavin 2022-12-02 21:47:07 +01:00
parent 12682c0abd
commit f91905c34a
1 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,8 @@ import org.hibernate.MappingException;
import java.sql.Types;
import static org.hibernate.internal.util.StringHelper.unquote;
/**
* @author Andrea Boriero
*/
@ -21,7 +23,7 @@ public class PostgreSQLIdentityColumnSupport extends IdentityColumnSupportImpl {
@Override
public String getIdentitySelectString(String table, String column, int type) {
return "select currval('" + table + '_' + column + "_seq')";
return "select currval('" + unquote(table) + '_' + unquote(column) + "_seq')";
}
@Override