Re: [DOCS] pg_total_relation_size() and CHECKPOINT - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [DOCS] pg_total_relation_size() and CHECKPOINT
Date
Msg-id 47EB98EA.7020402@dunslane.net
Whole thread Raw
In response to Re: [DOCS] pg_total_relation_size() and CHECKPOINT  ("Zubkovsky, Sergey" <Sergey.Zubkovsky@transas.com>)
Responses Re: [DOCS] pg_total_relation_size() and CHECKPOINT
List pgsql-hackers

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


pgsql-hackers by date:

Previous
From: "Zubkovsky, Sergey"
Date:
Subject: Re: [DOCS] pg_total_relation_size() and CHECKPOINT
Next
From: Alvaro Herrera
Date:
Subject: Re: Script binaries renaming