-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
A-sql-encodingRelating to the SQL/KV encoding.Relating to the SQL/KV encoding.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Description
lib/pq prints 24:00 time as 0001-01-01 00:00:00, which is indistinguishable from '00:00'. This is because time is represented as a time.Time in lib/pq.
root@127.0.0.1:51083/movr> select '24:00'::timetz;
time
-----------------------------
0000-01-01 00:00:00+00:00
(1 row)
Time: 320µs
root@127.0.0.1:51083/movr> select '24:00'::timetz::string;
text
------------
24:00:00
(1 row)
root@127.0.0.1:51083/movr> select '00:00'::timetz;
time
-----------------------------
0000-01-01 00:00:00+00:00
(1 row)
Time: 263µs
This breaks anything requiring a switch on time.Time to parse back into DTimeTZ (and DTime).
I think as a result, backups for time/timetz columns are broken if someone encoded 24:00 time in the database, since backups use lib/pq formatting.
Furthermore, this prevents us from using TestCopyRandom for 24:00 values for Time/TimeTZ.
Metadata
Metadata
Assignees
Labels
A-sql-encodingRelating to the SQL/KV encoding.Relating to the SQL/KV encoding.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.