8.4.1. bytea Hex Format

8.4.1. bytea Hex Format
8.4.1.bytea的十六进制格式
The “hex” format encodes binary data as 2 hexadecimal digits per byte, most significant nibble first.  The entire string is preceded by the sequence \x (to distinguish it from the escape format). In some  contexts, the initial backslash may need to be escaped by doubling it (see Section 4.1.2.1). For input, the hexadecimal digits can be either upper or lower case, and whitespace is permitted between digit  pairs (but not within a digit pair nor in the starting \x sequence). The hex format is compatible with a  wide range of external applications and protocols, and it tends to be faster to convert than the escape  format, so its use is preferred.
“ hex”格式将二进制数据编码为每字节2个十六进制数字,最高有效位在前。 整个字符串以序列\x开头(以将其与转义格式区分开)。在某些情况下,可能需要通过将其加倍来转义初始反斜杠(请参见第4.1.2.1节)。对于输入,十六进制数字可以是大写或小写,并且在数字对之间允许空格(但在数字对之内或在开始的\ x序列中均不允许)。十六进制格式与广泛的外部应用程序和协议兼容,并且其转换速度通常比转义格式更快,因此首选使用。
 
Example:
例如:
 
SELECT '\xDEADBEEF';
 
发布了341 篇原创文章 · 获赞 54 · 访问量 88万+

猜你喜欢

转载自blog.csdn.net/ghostliming/article/details/104630703
hex
今日推荐