Solved

database replication

Posted on 2007-03-27
4
312 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now