1
The restoration using pg_restore
, which is what is being used by Pgadmin does not support sql files as it is necessary to have backup format files generated.
To use the sql file, you can open the pgadmin console and choose from the menu the option Open > File, select the sql and then launch the Run action.
The best option, however, is to use psql (command line). Preferably in the same file directory, to avoid having to write the file path:
psql -h nomeservidor -U nomeusuario -d nomebancodedados < /caminho/nomearquivo.sql
or
psql -h nomeservidor -U nomeusuario -d nomebancodedados < nomearquivo.sql
For more assurance, you can connect to the server and call the file after connected:
1) Connect: psql -h nomeservidor -U nomeusuario -d nomebancodedados
2) Running the file: \i nomedoarquivo
"please use psql"
– Rovann Linhalis