Table of Contents

Postgres

Command Line

Postres’ command line interface can be used with

$ psql -U <user> <db>

Backup and Restore

http://www.postgresql.org/docs/current/static/backup-dump.html

Migrate to a newer Version

http://www.postgresql.org/docs/current/static/migration.html

Tips und Tricks

Grant on all tables

To grant a user some (or all) permissions on all tables in a database:

SELECT 'grant all on '||tablename||' to <user>;' FROM pg_tables WHERE tablename LIKE '<tname>';

It prints a list of commands to execute.