You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for non-default intervalstyles is missing. I don't think this is something many people are using, but worth to at least mention it in the docs.
set intervalstyle to default; -- default being `postgres`;select'1 day'::interval;
-- PostgresInterval { days: 1 }
set intervalstyle to 'iso_8601';
select'1 day'::interval;
-- PostgresInterval {}
Hmm, I think the right move here is to throw when one of these styles is detected until the library supports them. I found plenty of prior work on the 8601 duration format so I could probably steal some regexes and built a proper micro lib with tests:
Sure. ISO one is pretty straight forward, but postgres_verbose has a lot of caveats, like displaying negative values with ago (e.g. 1 year ago for -1 year).
Activity
bendrucker commentedon Jul 20, 2016
Hmm, I think the right move here is to throw when one of these styles is detected until the library supports them. I found plenty of prior work on the 8601 duration format so I could probably steal some regexes and built a proper micro lib with tests:
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=iso%208601%20interval%20parser
elmigranto commentedon Jul 20, 2016
Sure. ISO one is pretty straight forward, but
postgres_verbosehas a lot of caveats, like displaying negative values withago(e.g.1 year agofor-1 year).