w3resource
MySQL Tutorial

PostgreSQL ARRAY_PREPEND() function

ARRAY_PREPEND() function

This function is used to append an element to the beginning of an array.

Syntax:

array_prepend (anyelement, anyarray)

Return Type:

anyarray

PostgreSQL Version: 9.3

Example: PostgreSQL ARRAY_PREPEND() function

Code:

SELECT array_prepend(1, ARRAY[2,3]);

Sample Output:

 array_prepend
---------------
 {1,2,3}
(1 row)

Previous: ARRAY_LOWER function
Next: ARRAY_REMOVE function