Re: Unlogged tables cannot be truncated twice

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Greg Sabino Mullane <greg(at)endpoint(dot)com>
Subject: Re: Unlogged tables cannot be truncated twice
Date: 2011-05-31 00:47:49
Message-ID: 201105310247.50055.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tuesday, May 31, 2011 02:35:58 AM Andres Freund wrote:
> On Tuesday, May 31, 2011 02:14:00 AM Andres Freund wrote:
> > On Tuesday, May 31, 2011 01:56:05 AM Cédric Villemain wrote:
> > > I remove my own explanations as we conclude on the same thing.
> > > Attached is the fix by adding a (!reindex) in the index.c if().
> >
> > Thats imo wrong because it will break a plain REINDEX?
>
> > I think one possible correct fix would be the attached:
> My version was wrong as well because it did not observe RelationTruncate's
> nblocks argument. That function is used to "shorten" the relation in
> vacuum. So dropping the init fork there is not a good idea.
>
> So I think it is the simpler version of simply checking the existance of
> the fork before creating is ok.
Gna. gnargl. Coffe. Bed. ;)

There was an accidental hunk I added while removing some whitespace. That
would not have been good on a real commit.

Argh.

Attachment Content-Type Size
0001-Fix-file-existing-errors-uppon-recreation-of-an-unlo_v3.patch text/x-patch 1.3 KB
0001-Fix-file-existing-errors-uppon-recreation-of-an-unlo_v3.patch text/x-patch 1.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2011-05-31 01:27:22 Re: Unlogged tables cannot be truncated twice
Previous Message Andres Freund 2011-05-31 00:35:58 Re: Unlogged tables cannot be truncated twice