Solved

database replication

Posted on 2007-03-27
4
316 Views
Last Modified: 2008-02-01
I've replicated a database using the following commands:

pg_dump my_orig_database > outfile

createdb my_new_database
psql -d my_new_database < outfile

These should now be two completely separate databases, correct?  My problem is that after I did this and then made changes to my_orig_database through a web client, all of the new changes were also replicated to my_new_database.  The web client explicitly connects to my_orig_database so I don't see how this is possible.  Do I have to do anything different when creating/importing to the new database to ensure they are separate?

 

0
Comment
Question by:mock5c
  • 2
4 Comments
 
LVL 22

Expert Comment

by:earth man2
ID: 18923359
Totally illogical captain, it should do as you expect.
0
 
LVL 13

Accepted Solution

by:
anokun7 earned 50 total points
ID: 18958719
You need to use:

pg_dump -C my_orig_database > outfile

According to the documentation:

-C
    Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database you connect to before running the script.)
0
 
LVL 13

Expert Comment

by:anokun7
ID: 19220787
I think I have researched and spent enough time to provide a viable answer to the poster of this question. Having heard nothing from the OP, I assumed there were no further questions / clarifications needed.

I would be happy to split the points with all who assisted in this question.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jboss/PostgreSQL HA 7 633
Change IBM DB2 to MySQL or PostgreSQL 9 1,815
calculate change in each day in postgresql 3 337
python - read lines from text file into sql query 6 905
Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: http://www.postgresql.org/ (http://www.postgresql.org/) This requires some add-o…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question