fix an issue with postgres timestamp literals

This commit is contained in:
Gavin 2022-11-11 18:50:27 +01:00 committed by Gavin King
parent 53d9935237
commit 0b021e56f9
1 changed files with 6 additions and 1 deletions

View File

@ -1036,7 +1036,12 @@ public class PostgreSQLDialect extends Dialect {
appender.appendSql( '\'' );
break;
case TIMESTAMP:
appender.appendSql( "timestamp with time zone '" );
if ( temporalAccessor.isSupported( ChronoField.OFFSET_SECONDS ) ) {
appender.appendSql( "timestamp with time zone '" );
}
else {
appender.appendSql( "timestamp '" );
}
appendAsTimestampWithMicros( appender, temporalAccessor, supportsTemporalLiteralOffset(), jdbcTimeZone );
appender.appendSql( '\'' );
break;