Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 779AC47592C for ; Tue, 22 Oct 2002 11:04:44 -0400 (EDT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by postgresql.org (Postfix) with ESMTP id AB029476021 for ; Tue, 22 Oct 2002 11:04:40 -0400 (EDT) Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 (Debian)) id 1840aL-00024i-00 for ; Tue, 22 Oct 2002 11:04:45 -0400 Date: Tue, 22 Oct 2002 11:04:45 -0400 From: Andrew Sullivan To: pgsql-admin@postgresql.org Subject: Re: Upgrade to new version Message-ID: <20021022110445.H4016@mail.libertyrms.com> Mail-Followup-To: pgsql-admin@postgresql.org References: <3DA53046.8080007@wettzell.ifag.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3DA53046.8080007@wettzell.ifag.de>; from dassing@wettzell.ifag.de on Thu, Oct 10, 2002 at 09:46:14AM +0200 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/184 X-Sequence-Number: 6042 On Thu, Oct 10, 2002 at 09:46:14AM +0200, Reiner Dassing wrote: > Hello all! > > I would like to ask what would be the best procedure to upgrade to a > new version of PostgreSQL in a production system when there is a 'initdb' > necessary? > > Situation: > We are running PostgreSQL in a production system. There are about 1000 > selects and about 100 inserts per minute. If you're upgrading to 7.2.3 from 7.2.2, no initdb is required. But anyway, here's a general strategy: If you are using replication (and if not, this might be a good time to start looking at it), you can use it to minimise downtime. Here's how: 1. Add an additional replication target. Put up the new back end on another port, and start replicating into it. 2. When you are totally caught up (i.e. replication is merely sending in its most recent changes in each cycle), shut off the applications. 3. Reconfigure your client applications to use the new back end. 4. Check that replication has really caught up. Shut off the old back end (for safety). 5. Re-start your applications. I've done this. It works. You still have to shut off for a brief period, but it's minutes, and not hours. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110