pg_dump, pg_restore

Started by surabhi.ahujaabout 20 years ago3 messagesgeneral
Jump to latest
#1surabhi.ahuja
surabhi.ahuja@iiitb.ac.in

i am trying to do :

pg_dump -f op.tar -F t database_name

then i do

dropdb database_name

and then i do pg_restore op.tar

and when i do psql database_name

it says database does not exist.

where am i going wrong?

thanks,
regards
Surabhi

#2Pandurangan R S
pandurangan.r.s@gmail.com
In reply to: surabhi.ahuja (#1)
Re: pg_dump, pg_restore

Did you check if your pg_restore was successful?

I think you need to include the following option while using pg_dump &
pg_restore

-C, --create include/issue commands to create database

Show quoted text

On 2/6/06, surabhi.ahuja <surabhi.ahuja@iiitb.ac.in> wrote:

i am trying to do :

pg_dump -f op.tar -F t database_name

then i do

dropdb database_name

and then i do pg_restore op.tar

and when i do psql database_name

it says database does not exist.

where am i going wrong?

thanks,
regards
Surabhi

#3Javier Carlos
nediam@nediam.com.mx
In reply to: surabhi.ahuja (#1)
Re: pg_dump, pg_restore

Basing on the way you did the pg_dump (without the -C option), I think you
should have created the database before you performed the pg_restore,

You can see some examples of database backup/restore in this page:

http://nediam.com.mx/en/tips/backups_pgsql.php

Regards,
Javier

On Mon, 6 Feb 2006 10:54:27 +0530, surabhi.ahuja wrote

i am trying to do :

pg_dump -f op.tar -F t database_name

then i do

dropdb database_name

and then i do pg_restore op.tar

and when i do psql database_name

it says database does not exist.

where am i going wrong?

thanks,

regards

Surabhi

--
nediam.com.mx