If you’re getting an error that reads “ERROR: invalid input syntax for type integer” in PostgreSQL, it’s probably because you’re calling the ntile()
function with an argument of the wrong data type.
This error can occur when we pass the wrong type to the ntile()
function. We can get a different error depending on the type, but this error can occur when we pass a string.
To fix this issue, be sure to pass a positive integer to the function.
Continue reading