ARRAY TO STRING Function

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PostgreSQL ARRAY_TO_STRING() function

ARRAY_TO_STRING() function

This function is used to concatenate array elements using supplied delimiter and optional null string.

Syntax :

array_to_string(anyarray, text [, text])

Return Type :

text

PostgreSQL Version : 9.3

Example : PostgreSQL ARRAY_TO_STRING() function

SELECT array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*');

Output :

 array_to_string
-----------------
 1,2,3,*,5
(1 row)