Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E97621337BE8 for ; Mon, 7 Mar 2011 11:29:02 -0400 (AST) 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 68559-01 for ; Mon, 7 Mar 2011 15:28:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from omr9.networksolutionsemail.com (omr9.networksolutionsemail.com [205.178.146.59]) by mail.postgresql.org (Postfix) with ESMTP id 6EE831337C55 for ; Mon, 7 Mar 2011 11:26:48 -0400 (AST) Received: from cm-omr1 (mail.networksolutionsemail.com [205.178.146.50]) by omr9.networksolutionsemail.com (8.13.6/8.13.6) with ESMTP id p27FQlrG006582 for ; Mon, 7 Mar 2011 10:26:48 -0500 X-Authenticated-IP: 205.178.146.50 Received: from [205.178.146.50] ([205.178.146.50:37618] helo=webmail11) by cm-omr1 (envelope-from ) (ecelerity 2.2.2.41 r(31179/31189)) with ESMTP id 92/33-00371-739F47D4; Mon, 07 Mar 2011 10:26:48 -0500 Received: from 65.222.202.204 (mark@remingtondatabasesolutions.com [65.222.202.204]) by webmail11 (Netsol 11.2.30) with WEBMAIL id 26480; Mon, 07 Mar 2011 15:26:47 +0000 From: "Mark Johnson" To: pgsql-admin@postgresql.org Importance: Normal Sensitivity: Normal Message-ID: X-Mailer: Network Solutions Webmail, Build 11.2.30 X-Originating-IP: [65.222.202.204] X-Forwarded-For: [(null)] Date: Mon, 07 Mar 2011 15:26:47 +0000 Subject: pg_upgrade with link option MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="--=_vm_0011_W90502769_26480_1299511607" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.735 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_NUMERIC_HELO=1.164 X-Spam-Level: X-Archive-Number: 201103/77 X-Sequence-Number: 36949 ----=_vm_0011_W90502769_26480_1299511607 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I have a question about using pg_upgrade on a very large database. It is = not feasible to copy the data location, so I am looking at the link optio= n (pg_upgrade -k). That is, for the same reason it is not practical to ru= n pg_dumpall / restore it is not practical to copy several tens of teraby= tes of data files during each migration. My two very small tests have fai= led, no doubt due to my own lack of understanding. I did not have 8.x sof= tware on my test computer, so I was testing pg_upgrade using 9.0.2 and 9.= 0.3. Goal: in place upgrade of a cluster named test. Built a clean system with CentOS 5.4 x86_64 and 8 GB RAM (it is running i= n a VirtualBox VM under Windows 7). Installed 9.0.2 (PGHOME=3D/pghome/9.0.2). Created a cluster with a few million rows of sample data (PGDATA=3D/pgdat= a1/test). Just one regular table with one column of type numeric populate= d with numbers from 1 to 1,000,000. No indexes or other objects. pg_ctl stop Installed 9.0.3 (PGHOME=3D/pghome/9.0.3) including the contrib modules fo= r pg_upgrade and pg_upgrade_support. su - postgres and try to run initdb per documentation, but failed since t= he data dir is already populated. Should the documentation be modified to= note initdb is not to be run when using pg_upgrade in link mode? Ran "pg_upgrade -k" with additional flags for the old and new bin dirs, e= tc. as shown below. Through trial and error I found I must unset certain = env. variables. I am setting a number of other variables simply to shorte= n what must be typed on the command line for the pg_upgrade parameters. unset PGUSER unset PGDATABASE unset PGPORT unset PGHOME unset PGVER export PGCLUSTER1=3Dtest export PGCLUSTER2=3Dtest export PGPORT1=3D5432 export PGPORT2=3D5432 export PGDATA1=3D/pgdata1/test export PGDATA2=3D/pgdata1/test export PGBIN1=3D/pghome/9.0.2/bin export PGBIN2=3D/pghome/9.0.3/bin cd $PGHOME2 pg_upgrade -k -b $PGBIN1 -B $PGBIN2 -d $PGDATA1 -D $PGDATA2 -p $PGPORT1 -= P $PGPORT2 It errors out saying the cluster already has files, which of course is ex= pected since I am using the -k flag. Aside from the fact that I do not need to use pg_upgrade to do a minor re= lease and this is purely an example, what am I doing wrong? Am I misunder= standing the meaning of the link option? I assume for upgrade in place th= e old and new cluster are the same thing, just the binaries are different= . I also assume env. variables are allowed and you are not opening other = windows/sessions. -Mark ----=_vm_0011_W90502769_26480_1299511607 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

I have a question about using pg_upgr= ade on a very large database.  It is not feasible to copy the data l= ocation, so I am looking at the link option (pg_upgrade -k).  That i= s, for the same reason it is not practical to run pg_dumpall / restore it= is not practical to copy several tens of terabytes of data files during = each migration.  My two very small tests have failed, no doubt due t= o my own lack of understanding.  I did not have 8.x software on my t= est computer, so I was testing pg_upgrade using 9.0.2 and 9.0.3.

Goal:  in place upgrade of a cluster named test.

Built a clean system with CentOS 5.4 x86_64 and 8 GB RAM (it is runnin= g in a VirtualBox VM under Windows 7).

Installed 9.0.2 (PGHOME=3D/pghome/9.0.2).

Created a cluster with a few million rows of sample data (PGDATA=3D/pg= data1/test).  Just one regular table with one column of type numeric= populated with numbers from 1 to 1,000,000. No indexes or other objects.=  

pg_ctl stop

Installed 9.0.3 (PGHOME=3D/pghome/9.0.3) including the contrib modules= for pg_upgrade and pg_upgrade_support.

su - postgres and try to run initdb per documentation, but failed sinc= e the data dir is already populated.  Should the documentation be mo= dified to note initdb is not to be run when using pg_upgrade in link mode= ? 

Ran "pg_upgrade -k" with additional flags for the old and new bin dirs= , etc. as shown below.  Through trial and error I found I must unset= certain env. variables.  I am setting a number of other variables s= imply to shorten what must be typed on the command line for the pg_upgrad= e parameters.

unset PGUSER
unset PGDATABASE
unset PGPORT
unset PGHOME
un= set PGVER
export PGCLUSTER1=3Dtest
export PGCLUSTER2=3Dtest
expo= rt PGPORT1=3D5432
export PGPORT2=3D5432
export PGDATA1=3D/pgdata1/t= est
export PGDATA2=3D/pgdata1/test
export PGBIN1=3D/pghome/9.0.2/bi= n
export PGBIN2=3D/pghome/9.0.3/bin
cd $PGHOME2
pg_upgrade -k -b= $PGBIN1 -B $PGBIN2 -d $PGDATA1 -D $PGDATA2 -p $PGPORT1 -P $PGPORT2

It errors out saying the cluster already has files, which of course is= expected since I am using the -k flag.

Aside from the fact that I do not need to use pg_upgrade to do a minor= release and this is purely an example, what am I doing wrong?  Am I= misunderstanding the meaning of the link option?  I assume for upgr= ade in place the old and new cluster are the same thing, just the binarie= s are different.  I also assume env. variables are allowed and you a= re not opening other windows/sessions.

-Mark

 

----=_vm_0011_W90502769_26480_1299511607--