I have a dump file with a .SQL
extension (in fact it is a plain-text SQL file). I want to restore it into my created databases. I am using pgAdmin III, and when I use its "Restore Wizard" it does not highlight the button "Restore". Instead it is expecting a .backup
file extension.
I tried using shell the commands for restoring the dump, but it still didn't work.
I am a newbie at this. If anybody could help me I would be obliged.
Edit
I used following command to the Shell SQL Pane of PostGres while sitting at the newTestDB.
newTestDB-# \i E:\db-rbl-restore-20120511_Dump-20120514.sql
It still gave the same error ("Permission Denied").
After elevating permissions it just shows me the default tables of PostgreSQL:
List of tablespaces
Name | Owner | Location
-----------+----------+----------
pg_default | postgres |
pg_global | postgres |
(2 rows)
I don't know what to do for importing/restoring database from an SQL file.
By using pg_restore command you can restore postgres database
First open terminal type
Create new database
createdb [database name] -O [owner]
pg_restore -d [Database Name] [path of dump file]
Wait for completion of database restoring.
Remember that dump file should have read, write, execute access, so for that you can apply chmod command