Skip to content

Commit 1f65334

Browse files
committed
feat: normalize TIMESTAMPTZ values to UTC in PgSQL remote executor
PostgreSQL returns TIMESTAMPTZ column values as text like "2024-06-15 14:30:00+05:30" where the trailing offset was previously ignored (timezone handling was explicitly deferred). Switch the TIMESTAMPTZOID branch to parse_datetime_tz() so the offset is applied and the stored microseconds-since-epoch value is normalized to UTC.
1 parent 293b19b commit 1f65334

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/sql_engine/pgsql_remote_executor.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,8 @@ Value PgSQLRemoteExecutor::pg_field_to_value(
218218
}
219219

220220
case TIMESTAMPTZOID: {
221-
// PostgreSQL returns "YYYY-MM-DD HH:MM:SS+TZ" -- parse the datetime
222-
// part, ignoring timezone for now (as per spec: timezone handling deferred).
223-
int64_t us = datetime_parse::parse_datetime(data);
221+
// PostgreSQL returns "YYYY-MM-DD HH:MM:SS+TZ". Parse and normalize to UTC.
222+
int64_t us = datetime_parse::parse_datetime_tz(data);
224223
return value_timestamp(us);
225224
}
226225

0 commit comments

Comments
 (0)