psql -d appdb -c "GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO app;"

Category: Databases & SQL

psql -d appdb -c "GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO app;"

Grant DML on all current tables

Grants the four DML privileges on every table that exists right now in public. It does not cover tables created later; pair with ALTER DEFAULT PRIVILEGES for those. REVOKE ALL ... ON ALL TABLES undoes it.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.