- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit519fc1b
committed
Support +/- infinity in the interval data type.
This adds support for infinity to the interval data type, using thesame input/output representation as the other date/time data typesthat support infinity. This allows various arithmetic operations oninfinite dates, timestamps and intervals.The new values are represented by setting all fields of the intervalto INT32/64_MIN for -infinity, and INT32/64_MAX for +infinity. Thisensures that they compare as less/greater than all other intervalvalues, without the need for any special-case comparison code.Note that, since those 2 values were formerly accepted as legal finiteintervals, pg_upgrade and dump/restore from an old database will turnthem from finite to infinite intervals. That seems OK, since thoseexact values should be extremely rare in practice, and they areoutside the documented range supported by the interval type, whichgives us a certain amount of leeway.Bump catalog version.Joseph Koshakow, Jian He, and Ashutosh Bapat, reviewed by me.Discussion:https://postgr.es/m/CAAvxfHea4%2BsPybKK7agDYOMo9N-Z3J6ZXf3BOM79pFsFNcRjwA%40mail.gmail.com1 parentb41b1a7 commit519fc1b
File tree
25 files changed
+2541
-297
lines changed- contrib/btree_gin
- doc/src/sgml
- src
- backend/utils/adt
- include
- catalog
- datatype
- test/regress
- expected
- sql
- tools/pgindent
25 files changed
+2541
-297
lines changedLines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
306 | 306 |
| |
307 | 307 |
| |
308 | 308 |
| |
309 |
| - | |
310 |
| - | |
311 |
| - | |
| 309 | + | |
| 310 | + | |
312 | 311 |
| |
313 | 312 |
| |
314 | 313 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2328 | 2328 |
| |
2329 | 2329 |
| |
2330 | 2330 |
| |
2331 |
| - | |
| 2331 | + | |
2332 | 2332 |
| |
2333 | 2333 |
| |
2334 | 2334 |
| |
2335 | 2335 |
| |
2336 |
| - | |
| 2336 | + | |
2337 | 2337 |
| |
2338 | 2338 |
| |
2339 | 2339 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9565 | 9565 |
| |
9566 | 9566 |
| |
9567 | 9567 |
| |
9568 |
| - | |
| 9568 | + | |
9569 | 9569 |
| |
9570 | 9570 |
| |
9571 | 9571 |
| |
| |||
10462 | 10462 |
| |
10463 | 10463 |
| |
10464 | 10464 |
| |
10465 |
| - | |
| 10465 | + | |
| 10466 | + | |
| 10467 | + | |
| 10468 | + | |
| 10469 | + | |
10466 | 10470 |
| |
10467 | 10471 |
| |
10468 | 10472 |
| |
|
Lines changed: 47 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
| |||
2013 | 2014 |
| |
2014 | 2015 |
| |
2015 | 2016 |
| |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
2016 | 2022 |
| |
2017 | 2023 |
| |
2018 | 2024 |
| |
| |||
2049 | 2055 |
| |
2050 | 2056 |
| |
2051 | 2057 |
| |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
2052 | 2063 |
| |
2053 | 2064 |
| |
2054 | 2065 |
| |
| |||
2067 | 2078 |
| |
2068 | 2079 |
| |
2069 | 2080 |
| |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
2070 | 2086 |
| |
2071 | 2087 |
| |
2072 | 2088 |
| |
| |||
2090 | 2106 |
| |
2091 | 2107 |
| |
2092 | 2108 |
| |
2093 |
| - | |
| 2109 | + | |
| 2110 | + | |
2094 | 2111 |
| |
2095 | 2112 |
| |
2096 | 2113 |
| |
| |||
2100 | 2117 |
| |
2101 | 2118 |
| |
2102 | 2119 |
| |
2103 |
| - | |
2104 |
| - | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
2105 | 2123 |
| |
2106 | 2124 |
| |
2107 | 2125 |
| |
2108 |
| - | |
2109 |
| - | |
| 2126 | + | |
| 2127 | + | |
2110 | 2128 |
| |
2111 | 2129 |
| |
2112 | 2130 |
| |
| |||
2581 | 2599 |
| |
2582 | 2600 |
| |
2583 | 2601 |
| |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
2584 | 2607 |
| |
2585 | 2608 |
| |
2586 | 2609 |
| |
| |||
2603 | 2626 |
| |
2604 | 2627 |
| |
2605 | 2628 |
| |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
2606 | 2634 |
| |
2607 | 2635 |
| |
2608 | 2636 |
| |
| |||
2630 | 2658 |
| |
2631 | 2659 |
| |
2632 | 2660 |
| |
2633 |
| - | |
| 2661 | + | |
| 2662 | + | |
2634 | 2663 |
| |
2635 | 2664 |
| |
2636 | 2665 |
| |
| |||
2640 | 2669 |
| |
2641 | 2670 |
| |
2642 | 2671 |
| |
2643 |
| - | |
2644 |
| - | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
2645 | 2675 |
| |
2646 | 2676 |
| |
2647 | 2677 |
| |
2648 |
| - | |
2649 |
| - | |
| 2678 | + | |
| 2679 | + | |
2650 | 2680 |
| |
2651 | 2681 |
| |
2652 | 2682 |
| |
| |||
3096 | 3126 |
| |
3097 | 3127 |
| |
3098 | 3128 |
| |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
3099 | 3136 |
| |
3100 | 3137 |
| |
3101 | 3138 |
| |
|
Lines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3271 | 3271 |
| |
3272 | 3272 |
| |
3273 | 3273 |
| |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
3274 | 3277 |
| |
3275 | 3278 |
| |
3276 | 3279 |
| |
| |||
3574 | 3577 |
| |
3575 | 3578 |
| |
3576 | 3579 |
| |
| 3580 | + | |
| 3581 | + | |
3577 | 3582 |
| |
3578 | 3583 |
| |
3579 | 3584 |
| |
| |||
3597 | 3602 |
| |
3598 | 3603 |
| |
3599 | 3604 |
| |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
3600 | 3626 |
| |
3601 | 3627 |
| |
3602 | 3628 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4127 | 4127 |
| |
4128 | 4128 |
| |
4129 | 4129 |
| |
4130 |
| - | |
| 4130 | + | |
4131 | 4131 |
| |
4132 | 4132 |
| |
4133 | 4133 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4802 | 4802 |
| |
4803 | 4803 |
| |
4804 | 4804 |
| |
| 4805 | + | |
| 4806 | + | |
| 4807 | + | |
| 4808 | + | |
4805 | 4809 |
| |
4806 | 4810 |
| |
4807 | 4811 |
| |
|
0 commit comments
Comments
(0)