psql -d postgres -c "GRANT ALL PRIVILEGES ON DATABASE appdb TO app;"

Category: Databases & SQL

psql -d postgres -c "GRANT ALL PRIVILEGES ON DATABASE appdb TO app;"

Grant all privileges on a database

Grants every database-level privilege: connect, create, and temporary. It does not cover tables inside the database, which need separate GRANTs on the schema and tables. Audit with psql -c '\l' or pg_database queries.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.