aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-09-12 00:21:25 +0000
committerBruce Momjian <bruce@momjian.us>2002-09-12 00:21:25 +0000
commit81186865fec2e39a6a66e9435b32d7048c03dd32 (patch)
treeaf5f893ad28194be7fd631e68fc3a40ea2f027ac /doc/src
parente04069fbae07a8fe364675077ae40a89a93e4907 (diff)
downloadpostgresql-81186865fec2e39a6a66e9435b32d7048c03dd32.tar.gz
postgresql-81186865fec2e39a6a66e9435b32d7048c03dd32.zip
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 changes the name of split(text,text,int) to split_part(text,text,int) per Hannu's recommendation above. This can be applied without an initdb if current 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 is also included in the patch. Joe Conway
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 6ffde9e5296..054d495a927 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.121 2002/09/11 02:56:46 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.122 2002/09/12 00:21:24 momjian Exp $
PostgreSQL documentation
-->
@@ -1899,14 +1899,14 @@ PostgreSQL documentation
</row>
<row>
- <entry><function>split</function>(<parameter>string</parameter> <type>text</type>,
+ <entry><function>split_part</function>(<parameter>string</parameter> <type>text</type>,
<parameter>delimiter</parameter> <type>text</type>,
<parameter>column</parameter> <type>integer</type>)</entry>
<entry><type>text</type></entry>
<entry>Split <parameter>string</parameter> on <parameter>delimiter</parameter>
returning the resulting (one based) <parameter>column</parameter> number.
</entry>
- <entry><literal>split('abc~@~def~@~ghi','~@~',2)</literal></entry>
+ <entry><literal>split_part('abc~@~def~@~ghi','~@~',2)</literal></entry>
<entry><literal>def</literal></entry>
</row>