↑↓ select ↵ open ⌫ change scope Open full search

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

Functions / Aggregate Functions

Concatenates the non-null input values into a string.

Reading PG 18current·documented in 18 of 27 versions, 9.0 to 20

Signatures & examples

string_agg ( value text, delimiter text ) → text
Concatenates the non-null input values into a string. Each value after the first is preceded by the corresponding delimiter (if it's not null).
string_agg ( value bytea, delimiter bytea ORDER BY input_sort_columns ) → bytea
Concatenates the non-null input values into a string. Each value after the first is preceded by the corresponding delimiter (if it's not null).
Version history 5
  1. 16 → 17 changed
  2. 12 → 13 changed
  3. 9.3 → 9.4 changed
  4. 9.1 → 9.2 changed
  5. 8.4 → 9.0 added

Definition snapshot: b7bd9cda · English manual source