DUMP

Syntax

DUMP(expr[, return_fmt [, start_position [, length ] ] ])

Overview

DUMP returns TEXT with data type code, length in bytes, and internal representation of expr.

By default, the return value does not contain character set information.

To find the character set name of expr ,add 1000 to return_fmt.

Parameter

Parameter
Description

expr

Arbitrary expression that can come as a string.

Returns NULL if expr is NULL.

return_fmt

return_fmt specifies the type of the return value and can have one of the following values.

  • 8 returns the result in octal notation.

start_position

It indicates the starting position.

length

It specifies the length to display.

  • 10 returns the result in decimal.

  • 16 returns the result in hexadecimal.

  • 17 returns each byte output only if it can be interpreted as a printable character in the compiler's character set. Some ASCII characters may be output as ‘?’. Otherwise, they are output in hexadecimal. All NLS parameters are ignored. The DUMP function with return_fmt set to 17 should not depend on any specific output format.

Example

SELECT DUMP('abc'::TEXT, 1016);
                   dump                   
------------------------------------------
 Typ=25 Len=3 CharacterSet=UTF8: 61,62,63
(1 row)

Last updated