Fix a few omissions in the initcap() documentation & source code
comments, make some unrelated improvements to the functions documentation, and perform some minor consistency cleanup elsewhere. Original initcap() change from Dennis B., additional changes by Neil C.
This commit is contained in:
parent
2f17547c67
commit
f46a80c362
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.187 2004/02/22 04:14:06 neilc Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.188 2004/02/27 03:59:23 neilc Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -1033,7 +1033,7 @@ PostgreSQL documentation
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal><function>ascii</function>(<type>text</type>)</literal></entry>
|
<entry><literal><function>ascii</function>(<type>text</type>)</literal></entry>
|
||||||
<entry>integer</entry>
|
<entry><type>integer</type></entry>
|
||||||
<entry><acronym>ASCII</acronym> code of the first character of the argument</entry>
|
<entry><acronym>ASCII</acronym> code of the first character of the argument</entry>
|
||||||
<entry><literal>ascii('x')</literal></entry>
|
<entry><literal>ascii('x')</literal></entry>
|
||||||
<entry><literal>120</literal></entry>
|
<entry><literal>120</literal></entry>
|
||||||
@ -1109,16 +1109,20 @@ PostgreSQL documentation
|
|||||||
<row>
|
<row>
|
||||||
<entry><literal><function>initcap</function>(<type>text</type>)</literal></entry>
|
<entry><literal><function>initcap</function>(<type>text</type>)</literal></entry>
|
||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry>Convert first letter of each word (whitespace-separated) to upper case</entry>
|
<entry>
|
||||||
<entry><literal>initcap('hi thomas')</literal></entry>
|
Convert the first letter of each word to uppercase and the
|
||||||
|
rest to lowercase. Words are sequences of alphanumeric
|
||||||
|
characters separated by non-alphanumeric characters.
|
||||||
|
</entry>
|
||||||
|
<entry><literal>initcap('hi THOMAS')</literal></entry>
|
||||||
<entry><literal>Hi Thomas</literal></entry>
|
<entry><literal>Hi Thomas</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><literal><function>length</function>(<parameter>string</parameter>)</literal></entry>
|
<entry><literal><function>length</function>(<parameter>string</parameter> <type>text</type>)</literal></entry>
|
||||||
<entry><type>integer</type></entry>
|
<entry><type>integer</type></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Number of characters in string
|
Number of characters in <parameter>string</parameter>.
|
||||||
<indexterm>
|
<indexterm>
|
||||||
<primary>character string</primary>
|
<primary>character string</primary>
|
||||||
<secondary>length</secondary>
|
<secondary>length</secondary>
|
||||||
@ -1139,7 +1143,7 @@ PostgreSQL documentation
|
|||||||
<parameter>length</parameter> <type>integer</type>
|
<parameter>length</parameter> <type>integer</type>
|
||||||
<optional>, <parameter>fill</parameter> <type>text</type></optional>)</literal>
|
<optional>, <parameter>fill</parameter> <type>text</type></optional>)</literal>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>text</entry>
|
<entry><type>text</type></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Fill up the <parameter>string</parameter> to length
|
Fill up the <parameter>string</parameter> to length
|
||||||
<parameter>length</parameter> by prepending the characters
|
<parameter>length</parameter> by prepending the characters
|
||||||
@ -1157,7 +1161,8 @@ PostgreSQL documentation
|
|||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Remove the longest string containing only characters from
|
Remove the longest string containing only characters from
|
||||||
<parameter>characters</parameter> from the start of the string.
|
<parameter>characters</parameter> from the start of
|
||||||
|
<parameter>string</parameter>.
|
||||||
</entry>
|
</entry>
|
||||||
<entry><literal>ltrim('zzzytrim', 'xyz')</literal></entry>
|
<entry><literal>ltrim('zzzytrim', 'xyz')</literal></entry>
|
||||||
<entry><literal>trim</literal></entry>
|
<entry><literal>trim</literal></entry>
|
||||||
@ -1167,7 +1172,8 @@ PostgreSQL documentation
|
|||||||
<entry><literal><function>md5</function>(<parameter>string</parameter> <type>text</type>)</literal></entry>
|
<entry><literal><function>md5</function>(<parameter>string</parameter> <type>text</type>)</literal></entry>
|
||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Calculates the MD5 hash of given string, returning the result in hexadecimal.
|
Calculates the MD5 hash of <parameter>string</parameter>,
|
||||||
|
returning the result in hexadecimal.
|
||||||
</entry>
|
</entry>
|
||||||
<entry><literal>md5('abc')</literal></entry>
|
<entry><literal>md5('abc')</literal></entry>
|
||||||
<entry><literal>900150983cd24fb0 d6963f7d28e17f72</literal></entry>
|
<entry><literal>900150983cd24fb0 d6963f7d28e17f72</literal></entry>
|
||||||
@ -1210,9 +1216,10 @@ PostgreSQL documentation
|
|||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><literal><function>repeat</function>(<type>text</type>, <type>integer</type>)</literal></entry>
|
<entry><literal><function>repeat</function>(<parameter>string</parameter> <type>text</type>, <parameter>number</parameter> <type>integer</type>)</literal></entry>
|
||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry>Repeat text a number of times</entry>
|
<entry>Repeat <parameter>string</parameter> the specified
|
||||||
|
<parameter>number</parameter> of times</entry>
|
||||||
<entry><literal>repeat('Pg', 4)</literal></entry>
|
<entry><literal>repeat('Pg', 4)</literal></entry>
|
||||||
<entry><literal>PgPgPgPg</literal></entry>
|
<entry><literal>PgPgPgPg</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
@ -1253,7 +1260,8 @@ PostgreSQL documentation
|
|||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Remove the longest string containing only characters from
|
Remove the longest string containing only characters from
|
||||||
<parameter>characters</parameter> from the end of the string.
|
<parameter>characters</parameter> from the end of
|
||||||
|
<parameter>string</parameter>.
|
||||||
</entry>
|
</entry>
|
||||||
<entry><literal>rtrim('trimxxxx', 'x')</literal></entry>
|
<entry><literal>rtrim('trimxxxx', 'x')</literal></entry>
|
||||||
<entry><literal>trim</literal></entry>
|
<entry><literal>trim</literal></entry>
|
||||||
@ -4011,7 +4019,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>MONTH</literal></entry>
|
<entry><literal>MONTH</literal></entry>
|
||||||
<entry>full upper-case month name (blank-padded to 9 chars)</entry>
|
<entry>full uppercase month name (blank-padded to 9 chars)</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>Month</literal></entry>
|
<entry><literal>Month</literal></entry>
|
||||||
@ -4019,11 +4027,11 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>month</literal></entry>
|
<entry><literal>month</literal></entry>
|
||||||
<entry>full lower-case month name (blank-padded to 9 chars)</entry>
|
<entry>full lowercase month name (blank-padded to 9 chars)</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>MON</literal></entry>
|
<entry><literal>MON</literal></entry>
|
||||||
<entry>abbreviated upper-case month name (3 chars)</entry>
|
<entry>abbreviated uppercase month name (3 chars)</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>Mon</literal></entry>
|
<entry><literal>Mon</literal></entry>
|
||||||
@ -4031,7 +4039,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>mon</literal></entry>
|
<entry><literal>mon</literal></entry>
|
||||||
<entry>abbreviated lower-case month name (3 chars)</entry>
|
<entry>abbreviated lowercase month name (3 chars)</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>MM</literal></entry>
|
<entry><literal>MM</literal></entry>
|
||||||
@ -4039,7 +4047,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>DAY</literal></entry>
|
<entry><literal>DAY</literal></entry>
|
||||||
<entry>full upper-case day name (blank-padded to 9 chars)</entry>
|
<entry>full uppercase day name (blank-padded to 9 chars)</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>Day</literal></entry>
|
<entry><literal>Day</literal></entry>
|
||||||
@ -4047,11 +4055,11 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>day</literal></entry>
|
<entry><literal>day</literal></entry>
|
||||||
<entry>full lower-case day name (blank-padded to 9 chars)</entry>
|
<entry>full lowercase day name (blank-padded to 9 chars)</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>DY</literal></entry>
|
<entry><literal>DY</literal></entry>
|
||||||
<entry>abbreviated upper-case day name (3 chars)</entry>
|
<entry>abbreviated uppercase day name (3 chars)</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>Dy</literal></entry>
|
<entry><literal>Dy</literal></entry>
|
||||||
@ -4059,7 +4067,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>dy</literal></entry>
|
<entry><literal>dy</literal></entry>
|
||||||
<entry>abbreviated lower-case day name (3 chars)</entry>
|
<entry>abbreviated lowercase day name (3 chars)</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>DDD</literal></entry>
|
<entry><literal>DDD</literal></entry>
|
||||||
@ -4144,12 +4152,12 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>TH</literal> suffix</entry>
|
<entry><literal>TH</literal> suffix</entry>
|
||||||
<entry>upper-case ordinal number suffix</entry>
|
<entry>uppercase ordinal number suffix</entry>
|
||||||
<entry><literal>DDTH</literal></entry>
|
<entry><literal>DDTH</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>th</literal> suffix</entry>
|
<entry><literal>th</literal> suffix</entry>
|
||||||
<entry>lower-case ordinal number suffix</entry>
|
<entry>lowercase ordinal number suffix</entry>
|
||||||
<entry><literal>DDth</literal></entry>
|
<entry><literal>DDth</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.35 2004/02/03 17:34:02 tgl Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.36 2004/02/27 03:59:23 neilc Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="plpgsql">
|
<chapter id="plpgsql">
|
||||||
@ -392,7 +392,7 @@ END;
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
All key words and identifiers can be written in mixed upper and
|
All key words and identifiers can be written in mixed upper and
|
||||||
lower case. Identifiers are implicitly converted to lower-case
|
lower case. Identifiers are implicitly converted to lowercase
|
||||||
unless double-quoted.
|
unless double-quoted.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.49 2003/11/29 19:51:59 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.50 2004/02/27 03:59:23 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -106,9 +106,10 @@ upper(PG_FUNCTION_ARGS)
|
|||||||
*
|
*
|
||||||
* Purpose:
|
* Purpose:
|
||||||
*
|
*
|
||||||
* Returns string, with first letter of each word in uppercase,
|
* Returns string, with first letter of each word in uppercase, all
|
||||||
* all other letters in lowercase. A word is delimited by white
|
* other letters in lowercase. A word is defined as a sequence of
|
||||||
* space.
|
* alphanumeric characters, delimited by non-alphanumeric
|
||||||
|
* characters.
|
||||||
*
|
*
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user