Binary data v14

The following table shows data types that allow the storage of binary strings.

NameStorage sizeDescription
BINARYThe length of the binary stringFixed-length binary string, with a length between 1 and 8300
BLOBThe actual binary string plus 1 byte if the binary string is less than 127 bytes, or 4 bytes if the binary string is 127 bytes or greaterVariable-length binary string, with a maximum size of 1 GB
VARBINARYThe length of the binary stringVariable-length binary string, with a length between 1 and 8300

A binary string is a sequence of octets (or bytes). Binary strings are distinguished from characters strings by two characteristics:

  • Binary strings specifically allow storing octets of value zero and other "non-printable" octets (defined as octets outside the range 32 to 126).
  • Operations on binary strings process the actual bytes, whereas the encoding and processing of character strings depends on locale settings.