We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Postgres, it appears that specifying an interval with a fractional year quantity returns an interval whose precision is at best "months":
jordan=# select '1 year'::interval; interval ---------- 1 year (1 row) jordan=# select '1.5 year'::interval; interval --------------- 1 year 6 mons (1 row) jordan=# select '1.99 year'::interval; interval ---------------- 1 year 11 mons (1 row) jordan=# select '1.99999 year'::interval; interval ---------------- 1 year 11 mons (1 row)
In Cockroach, we do not truncate the precision, giving a "more accurate looking" but incompatible-with-Postgres response:
root@:26257/defaultdb> select '1 year'::interval; interval ------------ 1 year (1 row) Time: 0ms total (execution 0ms / network 0ms) root@:26257/defaultdb> select '1.5 year'::interval; interval ----------------- 1 year 6 mons (1 row) Time: 0ms total (execution 0ms / network 0ms) root@:26257/defaultdb> select '1.99 year'::interval; interval ----------------------------------- 1 year 11 mons 26 days 09:36:00 (1 row) Time: 0ms total (execution 0ms / network 0ms) root@:26257/defaultdb> select '1.99999 year'::interval; interval -------------------------------------- 1 year 11 mons 29 days 23:54:48.96 (1 row) Time: 0ms total (execution 0ms / network 0ms)
In the latter two cases, I guess we need to not even store the "extra precision" parts of the interval.
The text was updated successfully, but these errors were encountered:
Hi @jordanlewis, please add a C-ategory label to your issue. Check out the label system docs.
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.
Sorry, something went wrong.
1a973d2
Successfully merging a pull request may close this issue.
In Postgres, it appears that specifying an interval with a fractional year quantity returns an interval whose precision is at best "months":
In Cockroach, we do not truncate the precision, giving a "more accurate looking" but incompatible-with-Postgres response:
In the latter two cases, I guess we need to not even store the "extra precision" parts of the interval.
The text was updated successfully, but these errors were encountered: