Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E46F66332D3 for ; Mon, 21 Jun 2010 16:44:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 47315-01 for ; Mon, 21 Jun 2010 19:44:33 +0000 (UTC) X-Greylist: delayed 00:05:10.675935 by SQLgrey-1.7.6 Received: from smtp-out.abv.bg (smtp-out.abv.bg [194.153.145.70]) by mail.postgresql.org (Postfix) with ESMTP id C9E3F632EB9 for ; Mon, 21 Jun 2010 16:44:33 -0300 (ADT) Received: from mail23.abv.bg (nm2.ni.bg [192.168.151.161]) by smtp-out.abv.bg (Postfix) with ESMTP id 2FBB350D889; Mon, 21 Jun 2010 22:39:20 +0300 (EEST) DomainKey-Signature: a=rsa-sha1; s=smtp-out; d=abv.bg; c=simple; q=dns; b=B2cmufEur0g7pF2KPC8khoBSUZMuC4oM3rqEqB14D8S93YlN3Zw/4+7auWC0jJ51P wOf/qiNq0skH9SrEQ/bnpe3kzHGAvqFYg5NPfTZDJ6u/XE3zgvUBX4YkkbHKK2ZDuLS 8xqXeX4e9nfwEmTIIogK5CRorHHfnExyFSt7Ka4= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=abv.bg; s=smtp-out; t=1277149160; bh=bRGy2ISifIY2TO7n7+pPR24Ie17Jfk1PwedicGKwW74=; h=Date:From:To:Cc:Message-ID:Subject:MIME-Version:Content-Type: DKIM; b=NYAkVCAR19yBwaUBti0zBpMzvExOWTcyR4FxaYyrD5K8JgfauBsPXjmxQ3 Xj3EA5Cn2cEFEUZfn5lKmuCJYUi/rXGcLpa/qfWQIX6wJv70QjWTFGE9oX9M5s5rSK+ K9E2g9yq9772WjJpEj+105vk/gk1Py3nnb0KMxA865hzw0= Received: from nm2.abv.bg (localhost.localdomain [127.0.0.1]) by mail23.abv.bg (Postfix) with ESMTP id F3B0F16C132; Mon, 21 Jun 2010 22:39:26 +0300 (EEST) Date: Mon, 21 Jun 2010 22:39:26 +0300 (EEST) From: dimitar nen4ev To: tdai@loc.gov Cc: "pgsql-admin@postgresql.org" Message-ID: <166791665.26751.1277149166996.JavaMail.apache@nm2.abv.bg> Subject: Re: Programatically create, dump, copy to other server and restore database MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_26750_321590059.1277149166993" X-Mailer: AbvMail 2.0 X-Originating-IP: 78.90.148.151 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.092 tagged_above=-10 required=5 tests=BAYES_50=0.8, HTML_MESSAGE=0.001, HTML_NONELEMENT_30_40=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/202 X-Sequence-Number: 34980 ------=_Part_26750_321590059.1277149166993 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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-tp28941026p28941026.html 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

-----------------------------------------------------------------
Програма за световното първенство по футбол в ЮАР 2010. Виж ТУК! ------=_Part_26750_321590059.1277149166993 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi
Thanks for you reply.
I change it, because taking the fakt that ev= ery 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 t= he database on other server) in A i simply delete the unwanting records. An= d on server B i delete the unwanting records(which are the wanting on B) An= d again setup a relication servers for A and B.



-------- =D0=9E=D1=80=D0=B8=D0=B3=D0=B8=D0=BD=D0=B0=D0=BB=D0=BD=D0=BE =D0= =BF=D0=B8=D1=81=D0=BC=D0=BE --------
=D0=9E=D1=82: Dai, Tino tdai@loc.gov
=D0=9E=D1=82=D0=BD=D0=BE=D1=81=D0=BD=D0=BE: RE: [ADMIN] Programatically= create, dump, copy to other server and restore database
=D0=94=D0=BE: dimitarn , pgsql-admin@postgresql.org=20 =09
=D0=98=D0=B7=D0=BF=D1=80=D0=B0=D1=82=D0=B5=D0=BD=D0=BE =D0=BD=D0=B0: = =D0=9F=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D0=BD=D0=B8=D0=BA, 2010, =D0=AE= =D0=BD=D0=B8 21 22:25:46 EEST

You might be able to do that will slony (haven't tried) and you mig= ht 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.or= g] On Behalf Of dimitarn [dimitarn@abv.bg]
Sent: Sunday, June 20, 2010 12:12 PM
To: pg= sql-admin@postgresql.org
Subject: [ADMIN] Programatically create, dump, copy to other server and res= tore 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<= br> 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-crea= te%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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


-----------------------------------------------------------------=
=D0=9F=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=B0 =D0=B7=D0=B0 =D1=81=D0=B2= =D0=B5=D1=82=D0=BE=D0=B2=D0=BD=D0=BE=D1=82=D0=BE =D0=BF=D1=8A=D1=80=D0=B2= =D0=B5=D0=BD=D1=81=D1=82=D0=B2=D0=BE =D0=BF=D0=BE =D1=84=D1=83=D1=82=D0=B1= =D0=BE=D0=BB =D0=B2 =D0=AE=D0=90=D0=A0 2010. =D0=92=D0=B8=D0=B6 =D0=A2=D0= =A3=D0=9A! ------=_Part_26750_321590059.1277149166993--