pg_dump --no-owner --no-acl -Fc db > db.dump pg_dump --no-owner --no-acl --schema-only db > db.sqlRestore, deploy:
pg_restore -Fc -C db.dump | psql
pg_dump --no-owner --no-acl -Fc db > db.dump pg_dump --no-owner --no-acl --schema-only db > db.sqlRestore, deploy:
pg_restore -Fc -C db.dump | psql
BEGIN;
ALTER TABLE foo DROP COLUMN bar;
ALTER TABLE foo ADD COLUMN baz INET;
COMMIT;
update pg_database set datallowconn = TRUE where datname = 'template0'; \c template0 update pg_database set datistemplate = FALSE where datname = 'template1'; drop database template1; create database template1 with template = template0 encoding = 'UTF8' LC_CTYPE = 'en_US.utf8' LC_COLLATE = 'en_US.utf8'; update pg_database set datistemplate = TRUE where datname = 'template1'; \c template1 update pg_database set datallowconn = FALSE where datname = 'template0';