Re: Restore Database - Mailing list pgadmin-support

From Raymond O'Donnell
Subject Re: Restore Database
Date
Msg-id 54BFAA81.9090106@iol.ie
Whole thread Raw
In response to Restore Database  (Parth Desai <parthdesai724@gmail.com>)
List pgadmin-support
On 20/01/2015 18:37, Parth Desai wrote:
> Hello,
> 
> I have my postgres SQL database on my server PC and i want to restore
> the database backup from my server PC to Client PC using Batch
> file.Please help me how can i create batch file in order to restore my
> postgres databse.
> If possible please send me the example batch file to retore the database
> if i am having .BACKUP file with me.Looking forward towards the response.

What format is the backup file in - plain, custom, etc?

If it's plain, you can just pipe it directly to psql:
 psql -f <backup file> [...other options...] <database name>

If it's one of the others, you need to use pg_restore:
 http://www.postgresql.org/docs/9.4/static/app-pgrestore.html

Ray.

-- 
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie



pgadmin-support by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Restore & Backup using Batch file
Next
From: Roger Pack
Date:
Subject: feature request: better keyboard shortcuts for mac