- Notifications
You must be signed in to change notification settings - Fork5
Commit8118686
committed
Joe Conway wrote:
> Hannu Krosing wrote: > >> It seems that my last mail on this did not get through to the list >> ;( >> >> Please consider renaming the new builtin function >> split(text,text,int) >> >> to something else, perhaps >> >> split_part(text,text,int) >> >> (like date_part) >> >> The reason for this request is that 3 most popular scripting >> languages (perl, python, php) all have also a function with similar >> signature, but returning an array instead of single element and the >> (optional) third argument is limit (maximum number of splits to >> perform) >> >> I think that it would be good to have similar function in (some >> future release of) postgres, but if we now let in a function with >> same name and arguments but returning a single string instead an >> array of them, then we will need to invent a new and not so easy to >> recognise name for the "real" split function. >> > > This is a good point, and I'm not opposed to changing the name, but > it is too bad your original email didn't get through before beta1 was > rolled. The change would now require an initdb, which I know we were > trying to avoid once beta started (although we could change it > without *requiring* an initdb I suppose). > > I guess if we do end up needing an initdb for other reasons, we > should make this change too. Any other opinions? Is split_part an > acceptable name? > > Also, if we add a todo to produce a "real" split function that > returns an array, similar to those languages, I'll take it for 7.4.No one commented on the choice of name, so the attached patch changesthe name of split(text,text,int) to split_part(text,text,int) perHannu's recommendation above. This can be applied without an initdb ifcurrent beta testers are advised to run: update pg_proc set proname = 'split_part' where proname = 'split';in the case they want to use this function. Regression and doc fix isalso included in the patch.Joe Conway1 parente04069f commit8118686
File tree
4 files changed
+17
-17
lines changed- doc/src/sgml
- src
- include/catalog
- test/regress
- expected
- sql
4 files changed
+17
-17
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
1899 | 1899 |
| |
1900 | 1900 |
| |
1901 | 1901 |
| |
1902 |
| - | |
| 1902 | + | |
1903 | 1903 |
| |
1904 | 1904 |
| |
1905 | 1905 |
| |
1906 | 1906 |
| |
1907 | 1907 |
| |
1908 | 1908 |
| |
1909 |
| - | |
| 1909 | + | |
1910 | 1910 |
| |
1911 | 1911 |
| |
1912 | 1912 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
2130 | 2130 |
| |
2131 | 2131 |
| |
2132 | 2132 |
| |
2133 |
| - | |
| 2133 | + | |
2134 | 2134 |
| |
2135 | 2135 |
| |
2136 | 2136 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
719 | 719 |
| |
720 | 720 |
| |
721 | 721 |
| |
722 |
| - | |
| 722 | + | |
723 | 723 |
| |
724 |
| - | |
| 724 | + | |
725 | 725 |
| |
726 |
| - | |
| 726 | + | |
727 | 727 |
| |
728 | 728 |
| |
729 | 729 |
| |
730 | 730 |
| |
731 | 731 |
| |
732 |
| - | |
| 732 | + | |
733 | 733 |
| |
734 | 734 |
| |
735 | 735 |
| |
736 | 736 |
| |
737 | 737 |
| |
738 |
| - | |
| 738 | + | |
739 | 739 |
| |
740 | 740 |
| |
741 | 741 |
| |
742 | 742 |
| |
743 | 743 |
| |
744 |
| - | |
| 744 | + | |
745 | 745 |
| |
746 | 746 |
| |
747 | 747 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
288 | 288 |
| |
289 | 289 |
| |
290 | 290 |
| |
291 |
| - | |
| 291 | + | |
292 | 292 |
| |
293 |
| - | |
| 293 | + | |
294 | 294 |
| |
295 |
| - | |
| 295 | + | |
296 | 296 |
| |
297 |
| - | |
| 297 | + | |
298 | 298 |
| |
299 |
| - | |
| 299 | + | |
300 | 300 |
| |
301 |
| - | |
| 301 | + | |
302 | 302 |
| |
303 | 303 |
| |
304 | 304 |
| |
|
0 commit comments
Comments
(0)