Solved

database replication

Posted on 2007-03-27
4
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

718 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