select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / ARRAY FUNCTIONS AND OPERATORS

array_to_string

Read PG 18 manual ↗

Converts each array element to its text representation, and concatenates those separated by the delimiter string.

Signatures & examples

array_to_string ( array anyarray, delimiter text [, null_string text ] ) → text
Converts each array element to its text representation, and concatenates those separated by the delimiter string. If null_string is given and is not NULL, then NULL array entries are represented by that string; otherwise, they are omitted. See also string_to_array.
array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*') → 1,2,3,*,5
Version history 3
  1. PG 14 → 15changed
  2. PG 12 → 13changed
  3. PG 9.0 → 9.1changed

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source