I have a .sql file of the database backup. PostgreSQL is installed in my system and I use pgadmin4 to communicate with database. I want to restore this .sql file using pgadmin. Can someone please guide me.
An SQL script that was generated with pg_dump without the --inserts option cannot be restored with pgAdmin, because the COPY data are mixed with the statements. You need psql for that.
You could use one of the other backup formats ("custom", "directory" or "tar") and use pgAdmin to restore that. But all that pgAdmin does in this case is call pg_restore, so you might as well do that yourself from the command line.
Another option is to launch the "psql tool" from pgAdmin, which is nothing else than psql. Then you can load the dump with \i dumpfile.sql.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With