If you’re getting an error that reads “function array_sample(numeric, integer) does not exist” when using the array_sample()
function in PostgreSQL, it’s probably because your first argument is a numeric type instead of an array.
The first argument for this function must be an array.
To fix this error, be sure that your first argument to array_sample()
is an array, not a numeric value.