| PostgreSQL: Copy Database |
|
|
|
| Tech Notes - General |
| Written by Rick |
| Wednesday, 03 March 2010 00:00 |
|
It's not uncommon to run across a need to duplicate a database for testing purposes. PostgreSQL provides for the ability to duplicate the structure and data content with a single command; Â
 With any luck it's obvious one needs to replace "newdb" with the new database name and "originaldb" with the name of the source database. I've executed this command in phpPgAdmin (v4.2-beta-1) with success on a 657MB database. The process took approximately 10 minutes. I have no doubt the command can be executed from the pgsql prompt as well. PostgreSQL DB Server version 8.1.11. |





