In my code, I was receiving the error message:
ProgrammingError: permission denied for relation author
Although:
GRANT ALL ON db TO postgres;
may resolve this error for some, I later located:
Permission denied for relation
and found that you may want to name the relation, sequence or table instead of the DB. According to the link above, granting privilege on the DB might have more to do with accessing the connection, rather than sort of recursively going through the tables, relations and sequences and granting privilege on all of them.
At the very least, if you run into this error, read both this article and that one and see if either one resolves the problem.