public inbox for [email protected]  
help / color / mirror / Atom feed
From: Zubkovsky, Sergey <[email protected]>
To: Tom Lane <[email protected]>
To: Andrew Dunstan <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Gregory Stark <[email protected]>
Cc: [email protected]
Cc: Magnus Hagander <[email protected]>
Subject: Re: [DOCS] pg_total_relation_size() and CHECKPOINT
Date: Thu, 27 Mar 2008 15:30:01 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>


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.

Thanks,
Sergey Zubkovsky

-----Original Message-----
From: Tom Lane [mailto:[email protected]] 
Sent: Thursday, March 27, 2008 7:14 AM
To: Andrew Dunstan
Cc: Alvaro Herrera; Gregory Stark; Zubkovsky, Sergey;
[email protected]; Magnus Hagander
Subject: Re: [HACKERS] [DOCS] pg_total_relation_size() and CHECKPOINT

Andrew Dunstan <[email protected]> writes:
> I suspect that the size reported by stat() is a little delayed here,
but 
> the file system is keeping proper track of it, so the lseek that tries

> to extend the file fails at the right spot.

Hmm.  If it really works that way, one would hope Microsoft would've
documented that someplace.  Can anyone find a statement that Windows'
stat() is not current?

			regards, tom lane


Attachments:

  [application/octet-stream] lseek.c (3.9K, 2-lseek.c)
  download

view thread (24+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [DOCS] pg_total_relation_size() and CHECKPOINT
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox