473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

how to replicate database

Is there a way to replicate one-off(a copy of
duplicate) of an existing Postgres database.

regards,
caroline
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #1
4 22949
On Thu, 2003-09-11 at 09:15, Caroline Yong wrote:
Is there a way to replicate one-off(a copy of
duplicate) of an existing Postgres database.


pg_dump mydatabase > some_file

move some_file to another machine (or to duplicate the database on the
same server, use a new database name below)

createdb mydatabase
psql -d mydatabase < some_file

--
Oliver Elphick Ol************@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"I am crucified with Christ; nevertheless I live; yet
not I, but Christ liveth in me; and the life which I
now live in the flesh I live by the faith of the Son
of God, who loved me, and gave himself for me."
Galatians 2:20
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 11 '05 #2
i am having problem of running pg_dump. i am using
winXP home here. postgreSQL requested me to re-install
the application again as can't found cygz.dll file.

do u have any idea?

--- Oliver Elphick <ol**@lfix.co.uk> wrote:
On Thu, 2003-09-11 at 09:15, Caroline Yong wrote:
Is there a way to replicate one-off(a copy of
duplicate) of an existing Postgres database.


pg_dump mydatabase > some_file

move some_file to another machine (or to duplicate
the database on the
same server, use a new database name below)

createdb mydatabase
psql -d mydatabase < some_file

--
Oliver Elphick
Ol************@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A
614D 4C34 3E1D 0C1C

========================================
"I am crucified with Christ; nevertheless I
live; yet
not I, but Christ liveth in me; and the life
which I
now live in the flesh I live by the faith of
the Son
of God, who loved me, and gave himself for
me."
Galatians
2:20

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #3

On Thu, 11 Sep 2003, Caroline Yong wrote:
Is there a way to replicate one-off(a copy of
duplicate) of an existing Postgres database.

regards,
caroline


There's obviously the pg_dump utility (or pg_dumpall which also gets all the
global info like db users). You could also try:

createdb -T old-db new-db

as an interesting exercise, if you just want another copy in the same
cluster. I've not done that myself but I don't see why it wouldn't work,
someone else might know differently.

--
Nigel Andrews

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #4

On Thu, 11 Sep 2003, Caroline Yong wrote:
Is there a way to replicate one-off(a copy of
duplicate) of an existing Postgres database.

regards,
caroline


There's obviously the pg_dump utility (or pg_dumpall which also gets all the
global info like db users). You could also try:

createdb -T old-db new-db

as an interesting exercise, if you just want another copy in the same
cluster. I've not done that myself but I don't see why it wouldn't work,
someone else might know differently.

--
Nigel Andrews

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: | last post by:
both of 2 servers are MySQL. how can I replicate a database to one server from another? until now I zip the database folder and I extract the zip file in other MySQL server. But now I...
3
by: jaekim | last post by:
Hi. I am wondering if it is a good idea to replicate sql server db files using frs. I don't really know how the frs works, so does frs replicates the whole database from time to time or just...
2
by: Caroline Yong | last post by:
Is there a way to replicate one-off(a copy of duplicate) of an existing Postgres database. regards, caroline __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free,...
2
by: db2group88 | last post by:
we are using db2 udb v8.2 Express edition on windows 2003,we use third party vendor software to help replicate one server to another. Production server has three instances, each instances has one...
6
by: Stanley Sinclair | last post by:
Can I "replicate" from a flat file which changes, but is not a part of a formal database?
0
by: Paul Hobbs | last post by:
Hi All, I am trying to replicate the functionality of the HTML FileField control. I can use it just fine to prompt a user to browse to a file, and it retrieves the full path just fine. I can...
0
by: Paul Hobbs | last post by:
Hi All, I am trying to replicate the functionality of the HTML FileField control. I can use it just fine to prompt a user to browse to a file, and it retrieves the full path just fine. I can...
4
by: Peter | last post by:
Hello I have 2 locations, that each has an MSSQL 2000 server. Since the locations are to far from each other and the connection is very slow. My thought was to have a database on both servers...
0
by: ntech | last post by:
Hello, i have successfully installed Pgpool-II in linux but i need to know how to replicate databases using it. i dont understand the steps provided in different sites. so, can anyone help me to...
2
by: idioteque | last post by:
Hi everyone, I don't have a lot of experience in database management, but I'm trying to replicate a database that is currently being used on a live website. I'd like to replicate it so that our...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.