cockroachdb / cockroachdb/cockroach
Many Etc/[..] named timezone locations don't work
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
PostgreSQL:
=# select '2001-02-03T12:13:14 Etc/GMT+1'::timestamptz;
timestamptz
────────────────────────
2001-02-03 13:13:14+00
=# select '2001-02-03T12:13:14 Etc/UTC'::timestamptz;
timestamptz
────────────────────────
2001-02-03 12:13:14+00
In CockroachDB these don't work:
=> select '2001-02-03T12:13:14 Etc/UTC'::timestamptz;
ERROR: parsing as type timestamp: could not parse "2001-02-03T12:13:14 Etc/UTC"
=> select '2001-02-03T12:13:14 Etc/GMT+1'::timestamptz;
ERROR: parsing as type timestamp: could not parse "2001-02-03T12:13:14 Etc/GMT+1"
=> select '2001-02-03T12:13:14 Etc/Zulu'::timestamptz;
ERROR: parsing as type timestamp: could not parse "2001-02-03T12:13:14 Etc/Zulu"
But Etc/Universal and Etc/Greenwich do work:
=> select '2001-02-03T12:13:14 Etc/Universal'::timestamptz;
timestamptz
------------------------
2001-02-03 12:13:14+00
=> select '2001-02-03T12:13:14 Etc/Greenwich'::timestamptz;
timestamptz
------------------------
2001-02-03 12:13:14+00
I'm using the container from DockerHub, `:latest-v26.1`. This does have these files in the zoneinfo if I docker exec in to it:
# ls -l /usr/share/zoneinfo/Etc/
total 140
-rw-r--r-- 10 root root 114 Dec 10 00:00 GMT
-rw-r--r-- 10 root root 114 Dec 10 00:00 GMT+0
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+1
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT+10
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT+11
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT+12
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+2
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+3
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+4
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+5
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+6
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+7
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+8
-rw-r--r-- 1 root root 116 Dec 10 00:00 GMT+9
-rw-r--r-- 10 root root 114 Dec 10 00:00 GMT-0
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-1
-rw-r--r-- 1 root root 118 Dec 10 00:00 GMT-10
-rw-r--r-- 1 root root 118 Dec 10 00:00 GMT-11
-rw-r--r-- 1 root root 118 Dec 10 00:00 GMT-12
-rw-r--r-- 1 root root 118 Dec 10 00:00 GMT-13
-rw-r--r-- 1 root root 118 Dec 10 00:00 GMT-14
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-2
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-3
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-4
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-5
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-6
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-7
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-8
-rw-r--r-- 1 root root 117 Dec 10 00:00 GMT-9
-rw-r--r-- 10 root root 114 Dec 10 00:00 GMT0
-rw-r--r-- 10 root root 114 Dec 10 00:00 Greenwich
-rw-r--r-- 8 root root 114 Dec 10 00:00 UCT
-rw-r--r-- 8 root root 114 Dec 10 00:00 UTC
-rw-r--r-- 8 root root 114 Dec 10 00:00 Universal
-rw-r--r-- 8 root root 114 Dec 10 00:00 Zulu
Go's built-in time/tzdata also works:
package main
import (
"fmt"
"time"
_ "time/tzdata"
)
func main() {
l, err := time.LoadLocation("Etc/UTC")
// Output: Etc/UTC
fmt.Println(err, l)
}
So not sure why some don't work in CockroachDB?
Jira issue: CRDB-62374
Epic CRDB-60818
Contributor guide
Assessment
This issue has not been assessed yet.