|
-
+ role="functableentry">
-
bytea ,
bytesremoved bytea )
-
- bytea
-
- Remove the longest string containing only bytes appearing in
+ bytea
+
+ Removes the longest string containing only bytes appearing in
bytesremoved from the start and end of
-
- btrim('\000trim\001'::bytea, '\000\001'::bytea)
- trim
+
+ btrim('\x1234567890'::bytea, '\x9012'::bytea)
+ \x345678
+
|
-
+ role="functableentry">
-
get_bit(bytes bytea , offset bigint )
-
- int
-
- Extract n'th bit
- from binary string
+ integer
+
+ Extracts n'th bit
+ from binary string.
+
+ get_bit('\x1234567890'::bytea, 30)
+ 1
- get_bit('Th\000omas'::bytea, 45)
- 1
|
-
+ role="functableentry">
-
get_byte(bytes bytea , offset int )
-
- int
-
- Extract n'th byte
- from binary string
+
get_byte (
bytes bytea ,
+ integer
+
+ Extracts n'th byte
+ from binary string.
+
+ get_byte('\x1234567890'::bytea, 4)
+ 144
- get_byte('Th\000omas'::bytea, 4)
- 109
|
-
+ role="functableentry">
-
- int
-
- Number of bytes in binary string
length
of a binary string
binary strings, length
+ length ( bytea )
+ integer
+
+ Returns the number of bytes in the binary string.
+
+ length('\x1234567890'::bytea)
+ 5
- length('jo\000se'::bytea)
- 5
|
- int
-
- Number of characters in
bytes , assuming
- that it is text in the given
encoding
+
+ integer
+
+ Returns the number of characters in the binary string, assuming
+ that it is text in the given
encoding .
+
+ length('jose'::bytea, 'UTF8')
+ 4
- length('jose'::bytea, 'UTF8')
- 4
|
-
+ role="functableentry">
-
- text
-
- MD5 hash, with
- the result written in hexadecimal
+ md5 ( bytea )
+ text
+
+ Computes the MD5 hash of
+ the binary string, with the result written in hexadecimal.
+
+ md5('Th\000omas'::bytea)
+ 8ab2d3c9689aaf18&zwsp;b4958c334c82d8b1
- md5('Th\000omas'::bytea)
- 8ab2d3c9689aaf18&zwsp;b4958c334c82d8b1
|
-
+ role="functableentry">
-
- bytea
-
- Set n'th bit in
- binary string
+ bytea
+
+ Sets n'th bit in
+ binary string to
newvalue .
+
+ set_bit('\x1234567890'::bytea, 30, 0)
+ \x1234563890
- set_bit('Th\000omas'::bytea, 45, 0)
- Th\000omAs
|
-
+ role="functableentry">
-
- bytea
-
- Set n'th byte in
- binary string
+
set_byte (
bytes bytea ,
+ bytea
+
+ Sets n'th byte in
+ binary string to
newvalue .
+
+ set_byte('\x1234567890'::bytea, 4, 64)
+ \x1234567840
- set_byte('Th\000omas'::bytea, 4, 64)
- Th\000o@as
|
-
+ role="functableentry">
-
- bytea
-
- SHA-224 hash
+ sha224 ( bytea )
+ bytea
+
+ Computes the SHA-224 hash
+ of the binary string.
+
+ sha224('abc'::bytea)
+ \x23097d223405d8228642a477bda2&zwsp;55b32aadbce4bda0b3f7e36c9da7
- sha224('abc'::bytea)
- \x23097d223405d8228642a477bda2&zwsp;55b32aadbce4bda0b3f7e36c9da7
|
-
+ role="functableentry">
-
- bytea
-
- SHA-256 hash
+ sha256 ( bytea )
+ bytea
+
+ Computes the SHA-256 hash
+ of the binary string.
+
+ sha256('abc'::bytea)
+ \xba7816bf8f01cfea414140de5dae2223&zwsp;b00361a396177a9cb410ff61f20015ad
- sha256('abc'::bytea)
- \xba7816bf8f01cfea414140de5dae2223&zwsp;b00361a396177a9cb410ff61f20015ad
|
-
+ role="functableentry">
-
- bytea
-
- SHA-384 hash
+ sha384 ( bytea )
+ bytea
+
+ Computes the SHA-384 hash
+ of the binary string.
+
+ sha384('abc'::bytea)
+ \xcb00753f45a35e8bb5a03d699ac65007&zwsp;272c32ab0eded1631a8b605a43ff5bed&zwsp;8086072ba1e7cc2358baeca134c825a7
- sha384('abc'::bytea)
- \xcb00753f45a35e8bb5a03d699ac65007&zwsp;272c32ab0eded1631a8b605a43ff5bed&zwsp;8086072ba1e7cc2358baeca134c825a7
|
-
+ role="functableentry">
-
- bytea
-
- SHA-512 hash
+ sha512 ( bytea )
+ bytea
+
+ Computes the SHA-512 hash
+ of the binary string.
+
+ sha512('abc'::bytea)
+ \xddaf35a193617abacc417349ae204131&zwsp;12e6fa4e89a97ea20a9eeee64b55d39a&zwsp;2192992a274fc1a836ba3c23a3feebbd&zwsp;454d4423643ce80e2a9ac94fa54ca49f
- sha512('abc'::bytea)
- \xddaf35a193617abacc417349ae204131&zwsp;12e6fa4e89a97ea20a9eeee64b55d39a&zwsp;2192992a274fc1a836ba3c23a3feebbd&zwsp;454d4423643ce80e2a9ac94fa54ca49f
|
-
+ role="functableentry">
-
substr(bytes bytea , from int , count int )
-
- bytea
-
- Extract substring (same as
-
substring(bytea from from for count ) )
+
substr (
bytes bytea ,
start integer , count integer )
+ bytea
+
+ Extracts the substring of
bytes starting at
+ and extending for
count bytes if that is
+ specified. (Same
+
+ substr('\x1234567890'::bytea, 3, 2)
+ \x5678
- substr('alphabet', 3, 2)
- ph