Only cast LONG32 to text on PG to avoid type comparison related issues

This commit is contained in:
Christian Beikov 2024-11-27 16:33:40 +01:00
parent fc58d614d6
commit e93a07b4f9
2 changed files with 4 additions and 4 deletions

View File

@ -199,7 +199,7 @@ public class PostgreSQLLegacyDialect extends Dialect {
// "long" string types // "long" string types
case LONG32VARCHAR: case LONG32VARCHAR:
case LONG32NVARCHAR: case LONG32NVARCHAR:
return "text"; return "varchar";
case BLOB: case BLOB:
case CLOB: case CLOB:
case NCLOB: case NCLOB:
@ -234,7 +234,7 @@ public class PostgreSQLLegacyDialect extends Dialect {
case NVARCHAR: case NVARCHAR:
case LONG32VARCHAR: case LONG32VARCHAR:
case LONG32NVARCHAR: case LONG32NVARCHAR:
return "text"; return "varchar";
case BINARY: case BINARY:
case VARBINARY: case VARBINARY:
case LONG32VARBINARY: case LONG32VARBINARY:

View File

@ -220,7 +220,7 @@ public class PostgreSQLDialect extends Dialect {
// since there's no real difference between TEXT and VARCHAR, // since there's no real difference between TEXT and VARCHAR,
// except for the length limit, we can just use 'text' for the // except for the length limit, we can just use 'text' for the
// "long" string types // "long" string types
case LONG32VARCHAR, LONG32NVARCHAR -> "text"; case LONG32VARCHAR, LONG32NVARCHAR -> "varchar";
// use oid as the blob/clob type on Postgres because // use oid as the blob/clob type on Postgres because
// the JDBC driver doesn't allow using bytea/text via // the JDBC driver doesn't allow using bytea/text via
@ -246,7 +246,7 @@ public class PostgreSQLDialect extends Dialect {
@Override @Override
protected String castType(int sqlTypeCode) { protected String castType(int sqlTypeCode) {
return switch (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"; case BINARY, VARBINARY, LONG32VARBINARY -> "bytea";
default -> super.castType( sqlTypeCode ); default -> super.castType( sqlTypeCode );
}; };