Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

database replication

Posted on 2007-03-27
4
Medium Priority
?
324 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 150 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

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…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 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