By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,557 Members | 1,406 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,557 IT Pros & Developers. It's quick & easy.

Duplicate a DB

P: 1
Hello, I am new to postgreSQL and am trying to duplicate a DB.

I found this old discussion but can no longer comment on it so am starting a new one.

http://www.thescripts.com/forum/thread173311.html

I am using the pgadmin application (Mac OSX version) but can not see any way to duplicate the DB.

Can any one explain to me how to do it, via the admin app or a php script?

Thanks
Aug 27 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 534
If you want to have a copy of your database on the same server you can use the createdb command at the OS prompt:
createdb -T old-db new-db

See these docs for more information:
http://www.postgresql.org/docs/8.1/s...-createdb.html
http://www.postgresql.org/docs/8.1/s...-createdb.html

If you want to migrate this db from one server to another you can use the pg_dump utility.

Let us know if you have any problems with either approach.
Aug 30 '07 #2

P: 15
If you want to have a copy of your database on the same server you can use the createdb command at the OS prompt:
createdb -T old-db new-db

See these docs for more information:
http://www.postgresql.org/docs/8.1/s...-createdb.html
http://www.postgresql.org/docs/8.1/s...-createdb.html

If you want to migrate this db from one server to another you can use the pg_dump utility.

Let us know if you have any problems with either approach.


but the initdb command ,
how can use the initdb ,can i use the initdb to create the db
then how to write the command .
Sep 6 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.