3 ms·
Doesn't look like that works correctly for smaller units. For example: teo=> select extract(minutes from interval '70 minutes'); date_part ------
by Nullabillity 5y ago
Doesn't look like that works correctly for smaller units. For example:
teo=> select extract(minutes from interval '70 minutes');
date_part
-----------
10
(1 row)
For a sum this should return 70 (since there are obviously 70 minutes in total). Instead, it gets normalized to 1 hour and 10 minutes, and returns the minute component only.
- jimktrains2 5y agoI wouldn't say it's incorrect, but it is definitely different that what is sometimes needed. The only, and unsatisfactory, answer I've seen to get a timedelta in wholey one unit is to extract the epoch and divide by the number of seconds in that unit.