- Notifications
You must be signed in to change notification settings - Fork5
Commit5a86e5e
committed
Make CREATE INDEX run expression preprocessing on a proposed index expression
before it checks whether the expression is immutable. This covers two casesthat were previously handled poorly:1. SQL function inlining could reduce the apparent volatility of theexpression, allowing an expression to be accepted where it previously wouldnot have been. As an example, polymorphic functions must be marked with theworst-case volatility they have for any argument type, but for specificargument types they might not be so volatile, so indexing could be allowed.(Since the planner will refuse to inline functions in cases where theapparent volatility of the expression would increase, this won't breakany cases that were accepted before.)2. A nominally immutable function could have default arguments that arevolatile expressions. In such a case insertion of the defaults will increaseboth the apparent and actual volatility of the expression, so it is*necessary* to check this before allowing the expression to be indexed.Back-patch to 8.4, where default arguments were introduced.1 parent77e50a6 commit5a86e5e
1 file changed
+31
-3
lines changedLines changed: 31 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
| |||
775 | 776 |
| |
776 | 777 |
| |
777 | 778 |
| |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
778 | 806 |
| |
779 | 807 |
| |
780 | 808 |
| |
| |||
806 | 834 |
| |
807 | 835 |
| |
808 | 836 |
| |
809 |
| - | |
| 837 | + | |
810 | 838 |
| |
811 | 839 |
| |
812 | 840 |
| |
| |||
922 | 950 |
| |
923 | 951 |
| |
924 | 952 |
| |
925 |
| - | |
| 953 | + | |
926 | 954 |
| |
927 | 955 |
| |
928 | 956 |
| |
|
0 commit comments
Comments
(0)