Solved

database replication

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

867 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

16 Experts available now in Live!

Get 1:1 Help Now