| From: | Nandish Bhuva <Nandish(dot)bhuva(at)srmsoftwareinc(dot)com> |
|---|---|
| To: | "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
| Subject: | Timezone handling with timestamp without time zone columns |
| Date: | 2026-02-25 08:28:28 |
| Message-ID: | YT4P288MB01507D63F23F6B505AEB759E8375A@YT4P288MB0150.CANP288.PROD.OUTLOOK.COM |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi Team,
I would like to report a timezone-related issue we are encountering in our PostgreSQL database.
We have two columns:
*
empjob_utc_update_date
*
jstsk_lst_end_tm
Both columns are defined as timestamp without time zone.
Currently, we are observing the following values:
*
empjob_utc_update_date → 2026-02-19 06:26:23.830811
*
jstsk_lst_end_tm → 2026-02-19 01:23:46.016
Our entire application runs in the Canada/Pacific timezone. However, when comparing these two timestamps in our queries, we are getting incorrect results in the system.
It appears that:
*
empjob_utc_update_date is effectively storing UTC time.
*
jstsk_lst_end_tm is storing Canada/Pacific local time.
*
Since both columns are defined as timestamp without time zone, PostgreSQL does not apply any timezone conversion during comparison, which is leading to logical inconsistencies.
We would like clarification on the recommended approach to handle this scenario. Specifically:
1.
Should both columns be converted to timestamp with time zone
2.
Give me best solution for without even changing the column datatype.
Please advise on the best practice to ensure consistent timezone handling and accurate comparisons going forward.
Thanks in advance for your support.
Regards,
Nandish Bhuva
[cid:ba34352d-4c57-4251-9073-5b946953cdbf]
| From | Date | Subject | |
|---|---|---|---|
| Next Message | PALAYRET Jacques | 2026-02-25 11:14:28 | PostgreSQL query with FULL OUTER JOIN and subquery using column of GROUP BY expression ERROR: subquery uses ungrouped column from outer query |
| Previous Message | KK CHN | 2026-02-25 07:26:55 | Re: pgbackrest after a network outage unable to perform backup [fails always] |