Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id F11932E0059 for ; Thu, 27 Mar 2008 09:54:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 59436-10 for ; Thu, 27 Mar 2008 09:54:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from alexis.jtlnet.com (alexis.jtlnet.com [69.36.9.81]) by postgresql.org (Postfix) with ESMTP id 57C352E0057 for ; Thu, 27 Mar 2008 09:54:24 -0300 (ADT) Received: from [192.168.10.103] (cpe-075-177-177-228.nc.res.rr.com [::ffff:75.177.177.228]) (TLS: TLSv1/SSLv3,256bits,AES256-SHA) by alexis.jtlnet.com with esmtp; Thu, 27 Mar 2008 08:54:15 -0400 id 00080627.47EB98F8.00007E52 Message-ID: <47EB98EA.7020402@dunslane.net> Date: Thu, 27 Mar 2008 08:54:02 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20071019 Fedora/1.0.9-3.fc6 pango-text SeaMonkey/1.0.9 MIME-Version: 1.0 To: "Zubkovsky, Sergey" CC: Tom Lane , Alvaro Herrera , Gregory Stark , pgsql-hackers@postgresql.org, Magnus Hagander Subject: Re: [DOCS] pg_total_relation_size() and CHECKPOINT References: <528853D3C5ED2C4AA8990B504BA7FB850106DF2A@sol.transas.com> In-Reply-To: <528853D3C5ED2C4AA8990B504BA7FB850106DF2A@sol.transas.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/1100 X-Sequence-Number: 115901 Zubkovsky, Sergey wrote: > Maybe this helps: > > "It is not an error to set a file pointer to a position beyond the end > of the file. The size of the file does not increase until you call the > SetEndOfFile, WriteFile, or WriteFileEx function. A write operation > increases the size of the file to the file pointer position plus the > size of the buffer written, which results in the intervening bytes > uninitialized." > > http://msdn2.microsoft.com/en-us/library/aa365541(VS.85).aspx > > According to Windows' lseek implementation (attached) SetEndOfFile() > isn't called for this case. > > > Yes, but we immediately follow the lseek bye a write(). See src/backend/storage/smgr/md.c:mdextend() . cheers andrew