Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

JSON_SERIALIZE function

Focus mode
JSON_SERIALIZE function - Amazon Redshift

The JSON_SERIALIZE function serializes a SUPER expression into textual JSON representation to follow RFC 8259. For more information on that RFC, see The JavaScript Object Notation (JSON) Data Interchange Format.

The SUPER size limit is approximately the same as the block limit, and the VARCHAR limit is smaller than the SUPER size limit. Therefore, the JSON_SERIALIZE function returns an error when the JSON format exceeds the VARCHAR limit of the system. To check the size of a SUPER expression, see the JSON_SIZE function.

Syntax

JSON_SERIALIZE(super_expression)

Arguments

super_expression

A SUPER expression or column.

Return type

VARCHAR

Note

The returned VARCHAR value is always a non-null JSON string. If super_expression is NULL, JSON_SERIALIZE returns the JSON string 'null'.

Examples

To serialize a SUPER value to a string, use the following example.

SELECT JSON_SERIALIZE(JSON_PARSE('[10001,10002,"abc"]')); +---------------------+ | json_serialize | +---------------------+ | [10001,10002,"abc"] | +---------------------+

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.