in
characters from the start and end of
- btrim('xyxtrimyyx','xy')
+ btrim('xyxtrimyyx', 'xy')
trim
src_encoding is omitted, database
encoding is assumed.
- convert('text_in_unicode', 'UNICODE', 'LATIN1')
+ convert( 'text_in_unicode', 'UNICODE', 'LATIN1')
text_in_unicode represented in ISO 8859-1 encoding
Encode binary data to
ASCII-only representation. Supported
types are: base64>, hex>, escape>.
- encode('123\\000\\001', 'base64')
+ encode( '123\\000\\001', 'base64')
MTIzAAE=
Remove the longest string containing only characters from
characters from the start of the string.
- ltrim('zzzytrim','xyz')
+ ltrim('zzzytrim', 'xyz')
trim
Calculates the MD5 hash of given string, returning the result in hexadecimal.
md5('abc')
- 900150983cd24fb0d6963f7d28e17f72
+ 900150983cd24fb0 d6963f7d28e17f72
|
in an
SQL statement string.
Embedded quotes and backslashes are properly doubled.
- quote_literal('O\'Reilly')
+ quote_literal( 'O\'Reilly')
'O''Reilly'
Replace all occurrences in string of substring
- replace('abcdefabcdef', 'cd', 'XX')
+ replace( 'abcdefabcdef', 'cd', 'XX')
abXXefabXXef
Remove the longest string containing only characters from
characters from the end of the string.
- rtrim('trimxxxx','x')
+ rtrim('trimxxxx', 'x')
trim
Split string on delimiter
and return the given field (counting from one)
- split_part('abc~@~def~@~ghi','~@~',2)
+ split_part( 'abc~@~def~@~ghi', '~@~', 2)
def
string), but note the reversed
argument order)
- strpos('high','ig')
+ strpos('high', 'ig')
2
Convert number to its equivalent hexadecimal
representation
- to_hex(9223372036854775807)
- 7fffffffffffffff
+ to_hex(2147483647)
+ 7fffffff
|
concatenation
- '\\\\Post'::bytea || '\\047greSQL\\000'::bytea
- \\Post'greSQL\000
+ '\\\\Post'::bytea || '\\047gres\\000'::bytea
+ \\Post'gres\000
|
integer
Number of bytes in binary string
- octet_length('jo\\000se'::bytea)
+ octet_length( 'jo\\000se'::bytea)
5
in
bytes from the start and end of
- btrim('\\000trim\\000'::bytea,'\\000'::bytea)
+ btrim('\\000trim\\000'::bytea, '\\000'::bytea)
trim
24
|
- set_masklen(inet,integer)
+ set_masklen(inet, integer)
inet
set netmask length for inet value
- set_masklen('192.168.1.5/24',16)
+ set_masklen('192.168.1.5/24', 16)
192.168.1.5/16
|