Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 5A5B02E00C3 for ; Tue, 1 Apr 2008 02:16:35 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 48247-01-2 for ; Tue, 1 Apr 2008 02:16:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 2E8DC2E0074 for ; Tue, 1 Apr 2008 02:07:21 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m3157IIf020607; Tue, 1 Apr 2008 01:07:18 -0400 (EDT) To: Greg Smith cc: James Mansion , pgsql-performance@postgresql.org Subject: Re: POSIX file updates In-reply-to: References: <47F1413B.40109@mansionfamily.plus.com> Comments: In-reply-to Greg Smith message dated "Mon, 31 Mar 2008 18:44:27 -0400" Date: Tue, 01 Apr 2008 01:07:17 -0400 Message-ID: <20606.1207026437@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/2 X-Sequence-Number: 29495 Greg Smith writes: > Quoting from Lewine's "POSIX Programmer's Guide": > "After a write() to a regular file has successfully returned, any > successful read() from each byte position in the file that was modified by > that write() will return the data that was written by the write()...a > similar requirement applies to multiple write operations to the same file > position" Yeah, I imagine this is what the OP is thinking of. But note that what it describes is the behavior of concurrent write() and read() calls within a normally-functioning system. I see nothing there that constrains the order in which writes hit physical disk, nor (to put it another way) that promises anything much about the state of the filesystem after a crash. As you stated, PG is largely independent of these issues anyway. As long as the filesystem honors its spec-required contract that it won't claim fsync() is complete before all the referenced data is safely on persistent store, we are OK. regards, tom lane