Re: pgsql: Implement ALTER TABLE .. SET LOGGED / UNLOGGED

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Implement ALTER TABLE .. SET LOGGED / UNLOGGED
Date: 2014-08-23 20:03:28
Message-ID: 53F8F390.2050309@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers


On 08/23/2014 12:47 PM, Andres Freund wrote:
> On 2014-08-23 17:28:38 +0100, Simon Riggs wrote:
>> On 23 August 2014 14:57, Andres Freund <andres(at)anarazel(dot)de> wrote:
>>> On August 23, 2014 3:49:32 PM CEST, Simon Riggs <simon(at)2ndQuadrant(dot)com> wrote:
>>>> On 22 August 2014 19:30, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
>>>> wrote:
>>>>
>>>>> Implement ALTER TABLE .. SET LOGGED / UNLOGGED
>>>>>
>>>> When moving from unlogged to logged, where do we remove the init fork?
>>>>
>>>> Couldn't see the keywords fork or init anywhere in the patch, so maybe
>>>> its hidden somewhere.
>>> A new relfilenode is filled with the data - the old one, including the init fork, gets removed by the normal mechanics of rewriting rels.
>> Why do we do that? Table rewrite takes hours.
> There was a long thread about it on -hackers. Doing it without a rewrite
> and without loosing transactional semantics is really rather hard. And
> having the capability of doing it with a rewrite is better than not
> having it at all.
>
>

I think this needs to be documented very clearly and explicitly. My
question about the mechanism was similar to Simon's, and I looked in
vain for any clue about it in the committed docs.

cheers

andrew

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-08-24 15:56:55 pgsql: Fix another ancient memory-leak bug in relcache.c.
Previous Message Andres Freund 2014-08-23 16:47:47 Re: pgsql: Implement ALTER TABLE .. SET LOGGED / UNLOGGED