If you’re getting an error that reads “invalid input syntax for type integer…” when using the array_sample()
function in PostgreSQL, it’s probably because your second argument is not an integer.
The second argument for this function must be an integer.
To fix this error, be sure that your second argument to array_sample()
is an integer.