You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SELECT does not return TimeZone Info from a TIMESTAMP with TIME ZONE column #95
We are using the PostgreSQL native ODBC driver to select data from a PostgreSQL table with timestamp with time zone column. The driver is truncating the TIMEZONE component from the data and is just returning the timestamp value.
And when we run the program to select the data from both the columns, We get the same data for both the columns, where the tz info is getting truncated (basically getting the wrong data). Please note that the SQL_C_CHAR is used as the C data type for both the columns.
bash-4.4$ ./a.out
Connecting to database.
Connected to database.
Fetching results...
2025-03-06 18:10:10.732499 2025-03-06 18:10:10.732499
Attached the standalone ODBC program, using which the reported issue can be easily reproduced.
Can you please let us know how to retrieve the complete data (including the TZ component) from a TIMESTAMP with TIME ZONE type column using the PostgreSQL native ODBC driver.
From what I can tell ODBC does not support TIMESTAMP WITH TIME ZONE. I'm as surprised as you are.
I would not expect it to simply truncate it. Does it return it with the time adjusted correctly?
It simply truncates the time zone component without adjusting the data value.
Can the timetz/timestamptz data be returned as any other SQL_VARCHAR data column (to return the data as is)?
Can you please let us know what is the process for submitting the PR? Do I need to obtain any privileges to be able to submit the PR? If there is any document for this process, please share the same.
Activity
davecramer commentedon Mar 7, 2025
That's interesting. Thanks for the report
davecramer commentedon Mar 10, 2025
From what I can tell ODBC does not support TIMESTAMP WITH TIME ZONE. I'm as surprised as you are.
I would not expect it to simply truncate it. Does it return it with the time adjusted correctly?
raddakal commentedon Mar 11, 2025
It simply truncates the time zone component without adjusting the data value.
Can the timetz/timestamptz data be returned as any other SQL_VARCHAR data column (to return the data as is)?
Thanks.
davecramer commentedon Mar 14, 2025
I suppose it could. Feel free to provide a PR
raddakal commentedon Sep 19, 2025
Can you please let us know what is the process for submitting the PR? Do I need to obtain any privileges to be able to submit the PR? If there is any document for this process, please share the same.
We will try to work on this issue.
Thanks.
davecramer commentedon Sep 19, 2025
clone the repo into your own account. create a branch, make your changes and push to that branch. Then create a PR from your branch