Re: code question: storing INTO relation

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Neil Conway" <neilc(at)samurai(dot)com>
Cc: "Gavin Sherry" <swm(at)linuxworld(dot)com(dot)au>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: code question: storing INTO relation
Date: 2004-10-22 10:14:07
Message-ID: 009801c4b81f$df7043b0$ad01a8c0@zaphod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dominic Mitchell 2004-10-22 11:53:03 Re: Should libpq set close-on-exec flag on its socket?
Previous Message Simon Riggs 2004-10-22 09:39:11 Re: code question: storing INTO relation