pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedDuplicate Database
3+ messages / 2 participants
[nested] [flat]
* Duplicate Database
@ 2002-08-02 16:46 Areski Belaid <areski5@hotmail.com>
2002-08-02 17:16 ` Re: Duplicate Database Chris Ruprecht <chrup@earthlink.net>
0 siblings, 1 reply; 3+ messages in thread
From: Areski Belaid @ 2002-08-02 16:46 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Duplicate Database
2002-08-02 16:46 Duplicate Database Areski Belaid <areski5@hotmail.com>
@ 2002-08-02 17:16 ` Chris Ruprecht <chrup@earthlink.net>
2002-08-02 17:33 ` Re: Duplicate Database Areski Belaid <areski5@hotmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Chris Ruprecht @ 2002-08-02 17:16 UTC (permalink / raw)
To: Areski Belaid <areski5@hotmail.com>; pgsql-php
On Friday 02 August 2002 12:46 pm, Areski Belaid wrote:
> 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
try psql -f db.out newdb
run the whole thing as user postgres, that should work.
>
>
>
> 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
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Duplicate Database
2002-08-02 16:46 Duplicate Database Areski Belaid <areski5@hotmail.com>
2002-08-02 17:16 ` Re: Duplicate Database Chris Ruprecht <chrup@earthlink.net>
@ 2002-08-02 17:33 ` Areski Belaid <areski5@hotmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Areski Belaid @ 2002-08-02 17:33 UTC (permalink / raw)
To: pgsql-php
I just found and it's working good :
createdb --template=db new-db
=), haaaaaaaaaaa Que bien
On Friday 02 August 2002 12:46 pm, Areski Belaid wrote:
> 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
try psql -f db.out newdb
run the whole thing as user postgres, that should work.
>
>
>
> 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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-08-02 17:33 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-02 16:46 Duplicate Database Areski Belaid <areski5@hotmail.com>
2002-08-02 17:16 ` Chris Ruprecht <chrup@earthlink.net>
2002-08-02 17:33 ` Areski Belaid <areski5@hotmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox