forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd4070d1
committed
Fix incorrect declaration of citext's regexp_matches() functions.
These functions should return SETOF TEXT[], like the core functions theyare wrappers for; but they were incorrectly declared as returning justTEXT[]. This mistake had two results: first, if there was no match you gota scalar null result, whereas what you should get is an empty set (zerorows). Second, the 'g' flag was effectively ignored, since you would getonly one result array even if there were multiple matches, as reported byJeff Certain.While ignoring 'g' is a clear bug, the behavior for no matches might wellhave been thought to be the intended behavior by people who hadn't comparedit carefully to the core regexp_matches() functions. So we should treadcarefully about introducing this change in the back branches. Still, itclearly is a bug and so providing some fix is desirable.After discussion, the conclusion was to introduce the change in a 1.1version of the citext extension (as we would need to do anyway); 1.0 stillcontains the incorrect behavior. 1.1 is the default and only availableversion in HEAD, but it is optional in the back branches, where 1.0 remainsthe default version. People wishing to adopt the fix in back branches willneed to explicitly do ALTER EXTENSION citext UPDATE TO '1.1'. (I alsoprovided a downgrade script in the back branches, so people could go backto 1.0 if necessary.)This should be called out as an incompatible change in the 9.5 releasenotes, although we'll also document it in the next set of back-branchrelease notes. The notes should mention that any views or rules that usecitext's regexp_matches() functions will need to be dropped beforeupgrading to 1.1, and then recreated again afterwards.Back-patch to 9.1. The bug goes all the way back to citext's introductionin 8.4, but pre-9.1 there is no extension mechanism with which to managethe change. Given the lack of previous complaints it seems unnecessary tochange this behavior in 9.0, anyway.1 parent53e1498 commitd4070d1
File tree
4 files changed
+534
-1
lines changed- contrib/citext
4 files changed
+534
-1
lines changedLines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
7 | 9 |
| |
8 | 10 |
| |
9 | 11 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + |
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + |
0 commit comments
Comments
(0)