0

I have a GB PostgreSQL database dump. I need to import it into an Azure postgreSQL single server. I know the below command but I prefer the import done inside DB without command line in the hosting OS environment.

  • psql -U postgres -d mydatabase -f dumpfile.sql

Is there any db sql command to do the psql -f command job? For example, the MS sql server has several ways to do that (BULK INSERT, etc.) without powershell command line. Does pgSQL have similar functions?

1 Answer 1

1

To import dump file there is only option to use psql command or \i 'path file' command through command line. To avoid command line, you can use pgadmin tool to work with Azure Postgres SQL database. Steps are as follows.

  1. Connect your Azure Postgres SQL to pgadmin.
  2. Right click on Your Database Name.
  3. Click on Restore.
  4. Select file dumpfile.sql.
  5. Click on Restore.

File will import successfully.

Sign up to request clarification or add additional context in comments.

3 Comments

Is it possible to execute psql command in the Azure function Powershell? I thought pgSQL may have a statement like "restore database myDB from 'c:\db\mydb.bak'" in SQL server.
There is pg_restore command to restore the data into the target database from the dump file.
Is there any command for .sql dump file too?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.