In SQL Server, I can create a new database on the server from a backup from another box. I can't seem to find that functionality in pgAdmin4 with PostgreSQL10. It seems like all I can do is restore an existing database. Do I need to just create a blank database first?
Asked
Active
Viewed 616 times
0

sticky bit
- 36,626
- 12
- 31
- 42

Bob Wakefield
- 3,739
- 4
- 20
- 30
-
There is always a `pg_dumpall` command https://www.postgresql.org/docs/9.5/backup-dump.html#BACKUP-DUMP-ALL – Pavel Horal Jan 02 '19 at 23:23
1 Answers
2
You can use --create
or -C
in pg_dump
function to make database. From Documentation :
Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.)
For syntax :
pg_dump -C -U your_user -d your_db > filename.sql
or
pg_dump --create -U your_user -d your_db > filename.sql

dwir182
- 1,539
- 10
- 20