0

I am trying to import / restore a PostgreSQL database in pgAdmin on a Mac. I am doing this on a new machine that did not previously have a database on it. I installed and set up pgAdmin on the machine just recently and created a database with no files in it.

Specifically, I am trying to figure out where to enter the restore commands found on various forums.

On other forums, I see that others are saying to try the following commands:

psql [dbname] < [infile]

or

pg_restore [option...] [filename]

I have never used pgAdmin before so I have no idea where to enter them. I cannot enter anything in the SQL Pane of the database, nor can I enter it as a query (which I tried despite knowing it did not really make any sense>_>).

If it helps, my backup file is on my desktop and is in .dmp format (similar to Oracle). I might be able to get it in a different format if needed but the people I am talking to say that should suffice.

Please let me know if anything comes to mind or if you need any more information. I appreciate any help or pointers anyone has. :)

asked Dec 16, 2013 at 21:08
1

3 Answers 3

2

I have worked in WINDOWS , I can tell you what i did, you may get the point and do it in MAC .the pg_restore command and others like this i.e pg_dump and others are ther commands which can be run from the pgsql terminal which can be found in the postgres installation folder or may be in the start menu .

From the pgsql terminal following syntax may be used: pg_restore -i -h localhost -p 5432 -U username -d database name -v filename Commands can also be run from inside the Command Prompt cmd , in WINDOWS i did it like this :

'set path=C:\apache2triad\pgsql\bin C:\apache2triad\pgsql\bin\psql.exe -h localhost -p 5432 -U username-d database_name -f filename.sql pause.. '

For restoring database backup of .backup file from terminal: pg_restore -i -h localhost -p 5432 -U username -d database name -v filename

hope you may get some help here.

answered Dec 17, 2013 at 9:18
Sign up to request clarification or add additional context in comments.

Comments

1

Specifically, I am trying to figure out where to enter the restore commands found on various forums.

This is a misunderstanding. pgAdmin is a GUI. You are referring to command line invocations. You do not need pgAdmin to run those. Just open a shell and execute the commands. But read the manual on pg_restore and psql first.

answered Dec 17, 2013 at 4:25

Comments

0
answered Dec 16, 2013 at 21:22

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.