How to restore

Started by Sachin Srivastavaover 10 years ago5 messagesgeneral
Jump to latest
#1Sachin Srivastava
ssr.teleatlas@gmail.com

Dear Team,

If I have taken any backup successfully through pg_dump? How can I restore
this pg_dump(Sql file) without use of pg_restore.

There is any command line option or through psql, kindly inform to me.

Regards,
Sachin

#2Guillaume Lelarge
guillaume@lelarge.info
In reply to: Sachin Srivastava (#1)
Re: How to restore

Hi,

Le 10 août 2015 7:43 AM, "Sachin Srivastava" <ssr.teleatlas@gmail.com> a
écrit :

Dear Team,

If I have taken any backup successfully through pg_dump? How can I

restore this pg_dump(Sql file) without use of pg_restore.

There is any command line option or through psql, kindly inform to me.

If it's an SQL file, you can run it through psql.

--
Guillaume

#3Michael Paquier
michael@paquier.xyz
In reply to: Sachin Srivastava (#1)
Re: How to restore

On Mon, Aug 10, 2015 at 2:41 PM, Sachin Srivastava
<ssr.teleatlas@gmail.com> wrote:

Dear Team,

If I have taken any backup successfully through pg_dump? How can I restore
this pg_dump(Sql file) without use of pg_restore.
There is any command line option or through psql, kindly inform to me.

The way to restore a backup depends on the format a dump has been taken:
http://www.postgresql.org/docs/devel/static/app-pgdump.html
Except the plain format that need psql, all the others (custom,
directory and tar) need pg_restore.
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Guillaume Lelarge
guillaume@lelarge.info
In reply to: Sachin Srivastava (#1)
Re: How to restore

Please keep the list in your answers.

Le 10 août 2015 7:51 AM, "Sachin Srivastava" <ssr.teleatlas@gmail.com> a
écrit :

Dear Guillaume,

What is the syntax of this (psql), kindy confirm.

That can be: psql -f the_file the_database

Regards,
Sachin

On Mon, Aug 10, 2015 at 11:18 AM, Guillaume Lelarge <

guillaume@lelarge.info> wrote:

Hi,

Le 10 août 2015 7:43 AM, "Sachin Srivastava" <ssr.teleatlas@gmail.com> a

écrit :

Dear Team,

If I have taken any backup successfully through pg_dump? How can I

restore this pg_dump(Sql file) without use of pg_restore.

Show quoted text

There is any command line option or through psql, kindly inform to me.

If it's an SQL file, you can run it through psql.

--
Guillaume

#5Andomar
andomar@aule.net
In reply to: Sachin Srivastava (#1)
Re: How to restore

If I have taken any backup successfully through pg_dump? How can I restore this pg_dump(Sql file) without use of pg_restore.

You can send the file to psql, the command line client:

psql yourdb < yourbackup.sql

Or:

cat yourbackup.sql | psql yourdb

Kind regards,
Andomar

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general