Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 9ED602E3D25 for ; Sat, 22 Dec 2007 01:32:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 77549-04-3 for ; Sat, 22 Dec 2007 01:32:26 -0400 (AST) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.185]) by postgresql.org (Postfix) with ESMTP id CDAAA2E37F5 for ; Sat, 22 Dec 2007 01:20:32 -0400 (AST) Received: by rv-out-0910.google.com with SMTP id l15so822041rvb.43 for ; Fri, 21 Dec 2007 21:20:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=cnDGjz9GsIz/W2x89BKcisUWf8HXQBDBW0DoapWH3JI=; b=eqgzbmu9Jxwb8EbmG25yVnGMSJa2FfnomT+6lkbFoNunUnVf/AzvKogaGeo4XZmTKbF/p6Rfxq99w7qF4I3uVfsRu99AodArirndMqhRwQJk5dElwXr6zJrrP63lmti0Zv819U4jyNI2z/++6gCnA/bRFpYihqklppkRZ70R1TI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=pZrSoGogCK0ZFKbVj9jVFOZCSTaAg/3O0VsPjZsLmOvslCFubqdiTP8jnEbiVufmrzfxZYG5pyL9uL9YMRXCWa1LftEk6J/pTHip3C93Hi2s18g9J8SIrtOQVYhzijF2xKO4z67cnBvIc9ckXlXUK78/QTP3pvqegOBezlhEPG0= Received: by 10.141.34.12 with SMTP id m12mr1214505rvj.26.1198300831654; Fri, 21 Dec 2007 21:20:31 -0800 (PST) Received: from ?192.168.1.2? ( [220.233.16.89]) by mx.google.com with ESMTPS id b39sm1285049rvf.37.2007.12.21.21.20.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2007 21:20:30 -0800 (PST) Message-Id: <76654B35-D2A4-4167-81A0-F748E0263348@gmail.com> From: Tom Davies To: pgsql-admin@postgresql.org In-Reply-To: <15488.1198290830@sss.pgh.pa.us> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Re: on-line backup questions Date: Sat, 22 Dec 2007 16:20:26 +1100 References: <0FBA939C-2ED1-4400-BD3B-5290193837D0@gmail.com> <15488.1198290830@sss.pgh.pa.us> X-Mailer: Apple Mail (2.915) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/202 X-Sequence-Number: 27719 Thanks for the prompt response! On 22/12/2007, at 1:33 PM, Tom Lane wrote: > Tom Davies writes: >> >> 3. What's the best thing to do when I deliberately shut down >> PostgreSQL (i.e. pg_ctl stop)? When I start again I will be restoring >> from the most recent backup and rolling forward over the archived WAL >> files. I believe that shutdown leaves me with unarchived WAL files in >> pg_xlog. > > Yeah, you should archive the latest WAL file, but in 8.0 you'd have to > do that manually. (IIRC there isn't even a forced-xlog-switch > function > in that version to help you.) So in 8.2, when I do a backup I *don't* need to manually copy any WAL files?, and when I shut down I should: 1 call pg_switch_xlog() 2 wait for the WAL to be archived *if* pg_switch_xlog return a location after the end of the previously archived WAL 3 actually call pg_ctl stop Do I need to do 2, above, or can postgres wait until the previous WAL archive is complete? Thanks, Tom