X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E7AD99DD8D4 for ; Sat, 14 Jan 2006 14:41:46 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23262-06 for ; Sat, 14 Jan 2006 14:41:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id AB31A9DD8D9 for ; Sat, 14 Jan 2006 14:41:44 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k0EIfhaX020898; Sat, 14 Jan 2006 13:41:43 -0500 (EST) To: "Benjamin Arai" cc: pgsql-performance@postgresql.org Subject: Re: Ensuring data integrity with fsync=off In-reply-to: <000601c61936$38548770$fa48fd0a@uni> References: <000601c61936$38548770$fa48fd0a@uni> Comments: In-reply-to "Benjamin Arai" message dated "Sat, 14 Jan 2006 10:13:27 -0800" Date: Sat, 14 Jan 2006 13:41:43 -0500 Message-ID: <20897.1137264103@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.088 required=5 tests=[AWL=0.088] X-Spam-Score: 0.088 X-Spam-Level: X-Archive-Number: 200601/190 X-Sequence-Number: 16668 "Benjamin Arai" writes: > Right now I run "sync" afte the updates have finished to ensure that the > data is synced to disk but I am concerned about the segment data and > anything else I am missing that PostgreSQL explicitly handles. Is there > something I can do in addition to sync to tell PostgreSQL exlplicitly that > it is time to ensure everything is stored in its final destionation and etc? You need to give PG a CHECKPOINT command to flush stuff out of its internal buffers. After that finishes, a manual "sync" commnd will push everything down to disk. You realize, of course, that a system failure while the updates are running might leave your database corrupt? As long as you are prepared to restore from scratch, this might be a good tradeoff ... but don't let yourself get caught without an up-to-date backup ... regards, tom lane