Make Backup/Restore Postgres Database With No Owner
to do backup: pg_dump dbname -O -x > backupname.sql To restore: psql dbname < backupname.sql Options documentation: -O <-- No owner -x <-- No privileges
to do backup: pg_dump dbname -O -x > backupname.sql To restore: psql dbname < backupname.sql Options documentation: -O <-- No owner -x <-- No privileges
Short version: sudo -u postgres psql create database mydb; create user myuser with encrypted password 'password'; grant all privileges on database mydb to myuser;