diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java index e906643aa9..8416fa63cb 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java @@ -199,7 +199,7 @@ public class PostgreSQLLegacyDialect extends Dialect { // "long" string types case LONG32VARCHAR: case LONG32NVARCHAR: - return "text"; + return "varchar"; case BLOB: case CLOB: case NCLOB: @@ -234,7 +234,7 @@ public class PostgreSQLLegacyDialect extends Dialect { case NVARCHAR: case LONG32VARCHAR: case LONG32NVARCHAR: - return "text"; + return "varchar"; case BINARY: case VARBINARY: case LONG32VARBINARY: diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java index f4fde81282..7c3ac3f15d 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java @@ -220,7 +220,7 @@ public class PostgreSQLDialect extends Dialect { // since there's no real difference between TEXT and VARCHAR, // except for the length limit, we can just use 'text' for the // "long" string types - case LONG32VARCHAR, LONG32NVARCHAR -> "text"; + case LONG32VARCHAR, LONG32NVARCHAR -> "varchar"; // use oid as the blob/clob type on Postgres because // the JDBC driver doesn't allow using bytea/text via @@ -246,7 +246,7 @@ public class PostgreSQLDialect extends Dialect { @Override protected String castType(int sqlTypeCode) { return switch (sqlTypeCode) { - case CHAR, NCHAR, VARCHAR, NVARCHAR, LONG32VARCHAR, LONG32NVARCHAR -> "text"; + case CHAR, NCHAR, VARCHAR, NVARCHAR, LONG32VARCHAR, LONG32NVARCHAR -> "varchar"; case BINARY, VARBINARY, LONG32VARBINARY -> "bytea"; default -> super.castType( sqlTypeCode ); };