Binary Data Type

Applies to: ✅ Data Cloud SQL ✅ Tableau Hyper API

The bytes data type allows the storage of binary strings.

A binary string is a sequence of octets (or bytes). Binary strings differ from character strings in two ways.

  • Binary strings can store octets of value zero and other non-printable octets.
  • Operations on binary strings process the actual bytes. Processing of character strings depends on locale settings.

Use binary strings to store raw byte data and use character strings to store text.

Data Cloud SQL provides these aliases for the bytes type.

  • bytea
  • blob
  • varbinary

The input format is different from bytes, but the provided functions and operators are mostly the same.

The bytes type supports input and output by using the hex format.

The hex format encodes binary data as two hexadecimal digits per byte, the most significant nibble first. The sequence \x precedes the string. To escape the backslash character, use \\x. For input, the hexadecimal digits can be either upper or lower case.

Example: