Duplicate Database

From: "Areski Belaid" <areski5(at)hotmail(dot)com>
To: <pgsql-php(at)postgresql(dot)org>
Subject: Duplicate Database
Date: 2002-08-02 16:46:01
Message-ID: OE76IVwEBblN7eNYhaS0000ba07@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hello to everyone,

I have a application using Postgres DB and I going to create a new version
on the same server... I would like duplicate my database with all structure
and data
like that, I can update this new version and keep the last one active
during the release version.

BUT, doesm't work =(

First I create the backup, like that :
pg_dump > db.out

After I try to duplicate this one :

So I create a other user "new-user" and I create a new db "new-db" (new-user
is the owner new-db)
next step :
change 1 ligne on db.out file :
Replace : "\connect - dbname" by "\connect - new-db"

To finish, I try that :
psql new-db< db.out

Of course, it doesn't work, otherwise I won't disturb you =)

Error message:
1: You are now connected as new user new-db
2: ERROR: Relation 'table1' already exists
3: ERROR: Relation 'table1' already exists
4: ...

I tried a lot of think without success, Some helpsssssssss pleaseee.

Thanks to the community, Areski

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Chris Ruprecht 2002-08-02 17:16:45 Re: Duplicate Database
Previous Message angelo.rigo 2002-08-01 20:01:27 records retrieval