Re: Restore Database

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Parth Desai <parthdesai724(at)gmail(dot)com>, pgadmin-support(at)postgresql(dot)org
Subject: Re: Restore Database
Date: 2015-01-21 13:32:49
Message-ID: 54BFAA81.9090106@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)ie

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Roger Pack 2015-01-21 18:09:05 feature request: better keyboard shortcuts for mac
Previous Message Raymond O'Donnell 2015-01-21 13:30:28 Re: Restore & Backup using Batch file