| ascii(text) | integer | Returns the ASCII code of the first character of the argument. | ascii('x') | 120 | 
| btrim(stringtext,trimtext) | text | Remove (trim) the longest string consisting only of characters
       in trimfrom the start and end ofstring. | btrim('xyxtrimyyx','xy') | trim | 
| chr(integer) | text | Returns the character with the given ASCII code. | chr(65) | A | 
| convert(stringtext,
       [src_encodingname,]dest_encodingname) | text | Converts string using dest_encoding.
       The original encoding is specified bysrc_encoding.  Ifsrc_encodingis omitted, database
       encoding is assumed. | convert('text_in_unicode', 'UNICODE', 'LATIN1') | text_in_unicode represented in ISO 8859-1 | 
| initcap(text) | text | Converts first letter of each word (whitespace separated) to upper case. | initcap('hi thomas') | Hi Thomas | 
| length(string) | integer | length of string | length('jose') | 4 | 
| lpad(stringtext,lengthinteger
       [,filltext]) | text | Fills up the stringto lengthlengthby prepending the charactersfill(a space by default).  If thestringis already longer thanlengththen it is truncated (on the
       right). | lpad('hi', 5, 'xy') | xyxhi | 
| ltrim(stringtext,trimtext) | text | Removes the longest string containing only characters from trimfrom the start of the string. | ltrim('zzzytrim','xyz') | trim | 
| pg_client_encoding() | name | Returns current client encoding name. | pg_client_encoding() | SQL_ASCII | 
| repeat(text, integer) | text | Repeat text a number of times. | repeat('Pg', 4) | PgPgPgPg | 
| rpad(stringtext,lengthinteger
       [,filltext]) | text | Fills up the stringto lengthlengthby appending the charactersfill(a space by default).  If thestringis already longer thanlengththen it is truncated. | rpad('hi', 5, 'xy') | hixyx | 
| rtrim(stringtext,trimtext) | text | Removes the longest string containing only characters from trimfrom the end of the string. | rtrim('trimxxxx','x') | trim | 
| strpos(string,substring) | text | Locates specified substring. (same as
       position( substringinstring), but note the reversed
       argument order) | strpos('high','ig') | 2 | 
| substr(string,from[,count]) | text | Extracts specified substring. (same as substring( stringfromfromforcount)) | substr('alphabet', 3, 2) | ph | 
| to_ascii(text [,encoding]) | text | Converts text from multibyte encoding to ASCII. | to_ascii('Karel') | Karel | 
| translate(stringtext,fromtext,totext) | text | Any character in stringthat matches a
       character in thefromset is replaced by
       the corresponding character in thetoset. | translate('12345', '14', 'ax') | a23x5 | 
| encode(databytea,typetext) | text | Encodes binary data to ASCII-only representation.  Supported
       types are: 'base64', 'hex', 'escape'. | encode('123\\000\\001', 'base64') | MTIzAAE= | 
| decode(stringtext,typetext) | bytea | Decodes binary data from stringpreviously 
       encoded with encode().  Parameter type is same as in encode(). | decode('MTIzAAE=', 'base64') | 123\000\001 |