0

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?

sticky bit
  • 36,626
  • 12
  • 31
  • 42
Bob Wakefield
  • 3,739
  • 4
  • 20
  • 30

1 Answers1

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