get_bit and set_bit number bits from the right within each byte for example bit 0 is the least significant bit of the first byte, and bit 15 is the most significant bit of the second byte. Set_byte('Th\000omas'::bytea, 4, and set_byte number the first byte of a binary string as byte 0. escape converts zero bytes and high-bit-set bytes to octal sequences ( \ nnn) and doubles backslashes.Ĭalculates the MD5 hash of string, returning the result in hexadecimal Supported formats are: base64, hex, escape. Options for format are same as in encode.Įncode binary data into a textual representation. Other Binary String Functions Functionītrim('\000trim\001'::bytea, '\000\001'::bytea)ĭecode binary data from textual representation in string. Some of them are used internally to implement the SQL-standard string functions listed in Table 9-11. Trim('\000\001'::bytea from '\000Tom\001'::bytea)Īdditional binary string manipulation functions are available and are listed in Table 9-12. Remove the longest string containing only bytes appearing in bytes from the start and end of string Substring('Th\000omas'::bytea from 2 for 3) Overlay( string placing string from int ) SQL Binary String Functions and Operators Function