ARRAY REMOVE Function

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

PostgreSQL ARRAY_REMOVE() function

ARRAY_REMOVE() function

This function is used to remove all elements equal to the given value from the array (array must be one-dimensional).

Syntax :

array_remove(anyarray, anyelement)

Return Type :

anyarray

PostgreSQL Version : 9.3

Example : PostgreSQL ARRAY_REMOVE() function

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

Output :

 array_remove
--------------
 {1,3}
(1 row)