diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/identity/PostgreSQLIdentityColumnSupport.java b/hibernate-core/src/main/java/org/hibernate/dialect/identity/PostgreSQLIdentityColumnSupport.java index 0b8cdf84d6..874f0eca70 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/identity/PostgreSQLIdentityColumnSupport.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/identity/PostgreSQLIdentityColumnSupport.java @@ -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