From: Alvaro Herrera <alvherre@commandprompt.com>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Cc: Cédric Villemain <cedric.villemain.debian@gmail.com>
Cc: Greg Sabino Mullane <greg@endpoint.com>
Subject: Re: Unlogged tables cannot be truncated twice
Date: Mon, 30 May 2011 21:27:22 -0400
Message-ID: <1306805168-sup-4188@alvh.no-ip.org> (raw)
In-Reply-To: <201105310247.50055.andres@anarazel.de>
References: <20110530160043.GC3012@core.home>
<201105310214.00791.andres@anarazel.de>
<201105310235.58484.andres@anarazel.de>
<201105310247.50055.andres@anarazel.de>
Excerpts from Andres Freund's message of lun may 30 20:47:49 -0400 2011:
> 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.
Hmm, I wonder if what we should be doing here is observe isreindex in
index_build to avoid creating the init fork. Doing smgr access at that
level seems wrong.
> 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.
Hah :-)
--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: alvherre@commandprompt.com, andres@anarazel.de, cedric.villemain.debian@gmail.com, greg@endpoint.com
Subject: Re: Unlogged tables cannot be truncated twice
In-Reply-To: <1306805168-sup-4188@alvh.no-ip.org>
References: <20110530160043.GC3012@core.home> <201105310214.00791.andres@anarazel.de> <201105310235.58484.andres@anarazel.de> <201105310247.50055.andres@anarazel.de> <1306805168-sup-4188@alvh.no-ip.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox