PostgreSQL 18 · Backup and restore
Back up as plain SQL
Write a SQL script you can read and replay with psql.
pg_dump -U postgres -d mydb -f mydb.sql
Official PostgreSQL 18 documentation
PostgreSQL 18 · Backup and restore
Write a SQL script you can read and replay with psql.
pg_dump -U postgres -d mydb -f mydb.sql
Official PostgreSQL 18 documentation
Was this page helpful?