pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedProgramatically create, dump, copy to other server and restore database
3+ messages / 3 participants
[nested] [flat]
* Programatically create, dump, copy to other server and restore database
@ 2010-06-20 16:12 dimitarn <dimitarn@abv.bg>
0 siblings, 1 reply; 3+ messages in thread
From: dimitarn @ 2010-06-20 16:12 UTC (permalink / raw)
To: pgsql-admin
Hi
I have a database running on server A. I need to have my custom web
interface from which i partition/replicate part of the data to other server.
Example:
Server A there is table with records from 1 to 100k.
Create the same database on the other server, partition this table on other
server taking the records from 50k to 100k and replicate the all data from
the other t ables. Also all users, roles, indexes and so on on server B.
So my thoughts are to execute some how the dump script, then copy it to
server B, execute the create database and tables scripts, drop the indexes
on the partitioned table, (remove the records 1 to 50k from the dump file
or) execute the script and remove the records from 1 to 50k, add the
indexes.
OR
Copy the postgres data files(i don't know how they are organized in
postgres, but in mysql there are data nad index files) to the data file
directory on server B. I think this will immediately make the database
visible and working to postgres db server? And then remove the records from
1 to 50k.
If you have any other suggestions please share them :)
--
View this message in context: http://old.nabble.com/Programatically-create%2C-dump%2C-copy-to-other-server-and-restore-database-tp...
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Programatically create, dump, copy to other server and restore database
@ 2010-06-21 19:25 Dai, Tino <tdai@loc.gov>
parent: dimitarn <dimitarn@abv.bg>
0 siblings, 0 replies; 3+ messages in thread
From: Dai, Tino @ 2010-06-21 19:25 UTC (permalink / raw)
To: dimitarn <dimitarn@abv.bg>; pgsql-admin
You might be able to do that will slony (haven't tried) and you might be even be able to get away with a view
into the data depending on your requirements. -Tino
________________________________________
From: pgsql-admin-owner@postgresql.org [pgsql-admin-owner@postgresql.org] On Behalf Of dimitarn [dimitarn@abv.bg]
Sent: Sunday, June 20, 2010 12:12 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Programatically create, dump, copy to other server and restore database
Hi
I have a database running on server A. I need to have my custom web
interface from which i partition/replicate part of the data to other server.
Example:
Server A there is table with records from 1 to 100k.
Create the same database on the other server, partition this table on other
server taking the records from 50k to 100k and replicate the all data from
the other tables. Also all users, roles, indexes and so on on server B.
So my thoughts are to execute some how the dump script, then copy it to
server B, execute the create database and tables scripts, drop the indexes
on the partitioned table, (remove the records 1 to 50k from the dump file
or) execute the script and remove the records from 1 to 50k, add the
indexes.
OR
Copy the postgres data files(i don't know how they are organized in
postgres, but in mysql there are data nad index files) to the data file
directory on server B. I think this will immediately make the database
visible and working to postgres db server? And then remove the records from
1 to 50k.
If you have any other suggestions please share them :)
--
View this message in context: http://old.nabble.com/Programatically-create%2C-dump%2C-copy-to-other-server-and-restore-database-tp...
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Programatically create, dump, copy to other server and restore database
@ 2010-06-21 19:39 dimitar nen4ev <dimitarn@abv.bg>
0 siblings, 0 replies; 3+ messages in thread
From: dimitar nen4ev @ 2010-06-21 19:39 UTC (permalink / raw)
To: tdai@loc.gov; +Cc: pgsql-admin
Hi
Thanks for you reply.
I change it, because taking the fakt that every server will have slave replication(as fail over) i decided only to use it. i.e.
I have serve A with database test, and server B is replication database test.
So when i need to partition(meaning to separate 1/2 of the database on other server) in A i simply delete the unwanting records. And on server B i delete the unwanting records(which are the wanting on B) And again setup a relication servers for A and B.
-------- Оригинално писмо --------
От: Dai, Tino tdai@loc.gov
Относно: RE: [ADMIN] Programatically create, dump, copy to other server and
restore database
До: dimitarn ,
pgsql-admin@postgresql.org
Изпратено на: Понеделник, 2010, Юни 21 22:25:46 EEST
You might be able to do that will slony (haven't tried) and you might be even be able to get away with a view
into the data depending on your requirements. -Tino
________________________________________
From: pgsql-admin-owner@postgresql.org [pgsql-admin-owner@postgresql.org] On Behalf Of dimitarn [dimitarn@abv.bg]
Sent: Sunday, June 20, 2010 12:12 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Programatically create, dump, copy to other server and restore database
Hi
I have a database running on server A. I need to have my custom web
interface from which i partition/replicate part of the data to other server.
Example:
Server A there is table with records from 1 to 100k.
Create the same database on the other server, partition this table on other
server taking the records from 50k to 100k and replicate the all data from
the other tables. Also all users, roles, indexes and so on on server B.
So my thoughts are to execute some how the dump script, then copy it to
server B, execute the create database and tables scripts, drop the indexes
on the partitioned table, (remove the records 1 to 50k from the dump file
or) execute the script and remove the records from 1 to 50k, add the
indexes.
OR
Copy the postgres data files(i don't know how they are organized in
postgres, but in mysql there are data nad index files) to the data file
directory on server B. I think this will immediately make the database
visible and working to postgres db server? And then remove the records from
1 to 50k.
If you have any other suggestions please share them :)
--
View this message in context: http://old.nabble.com/Programatically-create%2C-dump%2C-copy-to-other-server-and-restore-database-tp...
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
<BR/><BR/>-----------------------------------------------------------------<BR/>
<a href="http://a.abv.bg/www/delivery/ck.php?oaparams=2__bannerid=2453__zoneid=63__oadest=http://sportni.bg/w...; target="_blank">
Програма за световното първенство по футбол в ЮАР 2010. Виж ТУК!
</a>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2010-06-21 19:39 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-06-20 16:12 Programatically create, dump, copy to other server and restore database dimitarn <dimitarn@abv.bg>
2010-06-21 19:25 ` Dai, Tino <tdai@loc.gov>
2010-06-21 19:39 Re: Programatically create, dump, copy to other server and restore database dimitar nen4ev <dimitarn@abv.bg>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox