If you’re getting an error that reads “function ntile() does not exist” in PostgreSQL, it could be that you’re calling the ntile()
function without any arguments.
This error message could be a bit misleading. The ntile()
function does in fact exist (if you’re using PostgreSQL 8.4 or later), but the error occurs when we don’t provide an argument, or if we provide an argument of the wrong type.