Re: code question: storing INTO relation - Mailing list pgsql-hackers

From Michael Paesold
Subject Re: code question: storing INTO relation
Date
Msg-id 009801c4b81f$df7043b0$ad01a8c0@zaphod
Whole thread Raw
In response to code question: storing INTO relation  (Neil Conway <neilc@samurai.com>)
Responses Re: code question: storing INTO relation
List pgsql-hackers
Simon Riggs wrote:

> Neil Conway wrote:
>> Why is that necessary?
>
> So you can choose whether to do this or not.  IMHO, it is important to 
> have
> the optimization, but it shouldn't be the case that EVERY statement is
> forced not to log.
>
> If I risk data loss, I'd like it to be my choice to do this. This effects
> COPY and CREATE INDEX also, though I know you aren't working on those at
> present. I will implement thos eif tyou do this for CTAS.

If I understand the original proposal correctly, there is no risk of data 
loss except in a temporary file. The data would be copied into a new file 
(without wal-logging), but after that, the file would be fsynced and the 
resulting changes would indeed be logged to WAL.

So if there is a crash during the copy, nothing valuable will be lost at 
all. If there is a crash after transaction commit of that transaction, 
nothing will be lost, again... the new file will have been fsynced already 
and everything else will be in WAL.

Best Regards,
Michael Paesold 



pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: code question: storing INTO relation
Next
From: dom@happygiraffe.net (Dominic Mitchell)
Date:
Subject: Re: Should libpq set close-on-exec flag on its socket?