- Notifications
You must be signed in to change notification settings - Fork5
Commit41dd50e
committed
Fix corner-case behaviors in JSON/JSONB field extraction operators.
Cause the path extraction operators to return their lefthand input,not NULL, if the path array has no elements. This seems more consistentsince the case ought to correspond to applying the simple extractionoperator (->) zero times.Cause other corner cases in field/element/path extraction to return NULLrather than failing. This behavior is arguably more useful than throwingan error, since it allows an expression index using these operators to bebuilt even when not all values in the column are suitable for theextraction being indexed. Moreover, we already had multipleinconsistencies between the path extraction operators and the simpleextraction operators, as well as inconsistencies between the JSON andJSONB code paths. Adopt a uniform rule of returning NULL rather thanthrowing an error when the JSON input does not have a structure thatpermits the request to be satisfied.Back-patch to 9.4. Update the release notes to list this as a behaviorchange since 9.3.1 parentebf20f6 commit41dd50e
File tree
10 files changed
+1060
-369
lines changed- doc/src/sgml
- src
- backend/utils/adt
- test/regress
- expected
- sql
10 files changed
+1060
-369
lines changedLines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10152 | 10152 |
| |
10153 | 10153 |
| |
10154 | 10154 |
| |
10155 |
| - | |
| 10155 | + | |
| 10156 | + | |
10156 | 10157 |
| |
10157 | 10158 |
| |
10158 | 10159 |
| |
| 10160 | + | |
| 10161 | + | |
| 10162 | + | |
10159 | 10163 |
| |
10160 | 10164 |
| |
10161 | 10165 |
| |
|
Lines changed: 0 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
415 | 415 |
| |
416 | 416 |
| |
417 | 417 |
| |
418 |
| - | |
419 |
| - | |
420 |
| - | |
421 | 418 |
| |
422 | 419 |
| |
423 | 420 |
| |
|
Lines changed: 33 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
139 | 172 |
| |
140 | 173 |
| |
141 | 174 |
| |
|
0 commit comments
Comments
(0)