If you’re getting an error that reads “function array_shuffle(integer) does not exist” when using the array_shuffle()
function in PostgreSQL, it’s probably because the argument you’re passing to the function is not an array.
More specifically, this error message implies that you’re passing an integer. The same error can occur when passing other non-array types (such as numeric), but the solution is the same.
The argument for this function must be an array.
To fix this error, replace the integer value with an array value when calling the array_shuffle()
function.
Continue reading →