Re: Programatically create, dump, copy to other server and restore database

From: "Dai, Tino" <tdai(at)loc(dot)gov>
To: dimitarn <dimitarn(at)abv(dot)bg>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Programatically create, dump, copy to other server and restore database
Date: 2010-06-21 19:25:46
Message-ID: 1CA7FF980DA3824F9A5C31532B7A40DCDAB310E5@LCXCLMB01.LCDS.LOC.GOV
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org [pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of dimitarn [dimitarn(at)abv(dot)bg]
Sent: Sunday, June 20, 2010 12:12 PM
To: pgsql-admin(at)postgresql(dot)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-tp28941026p28941026.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.

--
Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2010-06-21 19:37:54 Re: nmsbdmgr doesnt start
Previous Message Alex Hunsaker 2010-06-21 19:05:52 Re: High availability with Postgres