Commit 6f19a8c
committed
Teach eval_const_expressions to constant-fold LEAST/GREATEST expressions.
Doing this requires an assumption that the invoked btree comparison
function is immutable. We could check that explicitly, but in other
places such as contain_mutable_functions we just assume that it's true,
so we may as well do likewise here. (If the comparison function's
behavior isn't immutable, the sort order in indexes built with it would
be unstable, so it seems certainly wrong for it not to be so.)
Vik Fearing
Discussion: https://postgr.es/m/c6e8504c-4c43-35fa-6c8f-3c0b80a912cc@2ndquadrant.com1 parent e0ef136 commit 6f19a8c
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3378 | 3378 | | |
3379 | 3379 | | |
3380 | 3380 | | |
| 3381 | + | |
3381 | 3382 | | |
3382 | 3383 | | |
3383 | 3384 | | |
3384 | 3385 | | |
3385 | 3386 | | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
3386 | 3391 | | |
3387 | 3392 | | |
3388 | 3393 | | |
| |||
3783 | 3788 | | |
3784 | 3789 | | |
3785 | 3790 | | |
3786 | | - | |
| 3791 | + | |
3787 | 3792 | | |
3788 | 3793 | | |
3789 | 3794 | | |
| |||
0 commit comments