postgresql function for loop append to array example Example: postgresql append array array_append(anyarray, anyelement);