Re: [DOCS] pg_total_relation_size() and CHECKPOINT

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Zubkovsky, Sergey" <Sergey(dot)Zubkovsky(at)transas(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: [DOCS] pg_total_relation_size() and CHECKPOINT
Date: 2008-03-27 12:54:02
Message-ID: 47EB98EA.7020402@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs 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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2008-03-27 13:54:12 Re: [DOCS] pg_total_relation_size() and CHECKPOINT
Previous Message Zubkovsky, Sergey 2008-03-27 12:30:01 Re: [DOCS] pg_total_relation_size() and CHECKPOINT

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-03-27 13:09:03 Re: Script binaries renaming
Previous Message Zdenek Kotala 2008-03-27 12:35:16 Re: Fix pg_dump dependency on postgres.h