Wrong timestamp to date cast for dates predating 1970-01-01 #42937
Labels
A-sql-pgcompat
Semantic compatibility with PostgreSQL
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
S-3-ux-surprise
Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.
Describe the problem
When casting a timestamp before
1970-01-01
to date, a wrong result is producedTo Reproduce
Run this SQL query in PostgreSQL and CockroachDB:
The expected result (as observed in PostgreSQL) is that both timestamps are truncated to December 30:
However, in CockroachDB, I'm getting:
I'm using:
Environment:
The text was updated successfully, but these errors were encountered: