psql -d appdb -c "GRANT USAGE ON SCHEMA public TO app;"
Let a role use the public schema
USAGE lets the role see and enter the schema, the prerequisite for touching anything in it. On modern PostgreSQL the public schema is no longer open to everyone by default. Usually paired with a table-level GRANT.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.