| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | miracee <sho(at)miracee(dot)de> |
| Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Inconsistent time zone handling in timetz |
| Date: | 2026-11-18 18:10:19 |
| Message-ID: | 907221.1795025419@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
miracee <sho(at)miracee(dot)de> writes:
> # SELECT '10:00 CET'::timetz;
> timetz
> -------------
> 10:00:00+01
> (1 row)
> # SELECT '10:00 Europe/Berlin'::timetz;
> ERROR: invalid input syntax for type time with time zone: "10:00 Europe/Berlin"
> LINE 1: SELECT '10:00 Europe/Berlin'::timetz;
This is documented, no? [1]
... You can also specify a date but it will be ignored, except when
you use a time zone name that involves a daylight-savings rule,
such as America/New_York. In this case specifying the date is
required in order to determine whether standard or
daylight-savings time applies. The appropriate time zone offset is
recorded in the time with time zone value and is output as stored;
it is not adjusted to the active time zone.
I'd agree that the error message is pretty nonspecific :-(. However,
the view this project takes is that timetz is a type with little if
any real-world use, so we're unlikely to put much effort into making
it more user-friendly.
regards, tom lane
[1] https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-INPUT-TIMES
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | Michael Ries | 2026-11-18 18:06:26 | Stale partition constraint on sub-partitions of a partitioned DEFAULT partition after a sibling is detached/dropped/created |