Re: Error with index on unlogged table - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Error with index on unlogged table
Date
Msg-id 20151212123044.GD17938@alap3.anarazel.de
Whole thread Raw
In response to Re: Error with index on unlogged table  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 2015-12-11 16:54:45 +0900, Michael Paquier wrote:
> +                       if (rel->rd_rel->relpersistence ==
> RELPERSISTENCE_PERMANENT ||
> +                               (rel->rd_rel->relpersistence ==
> RELPERSISTENCE_UNLOGGED &&
> +                                forkNum == INIT_FORKNUM))
> +                               log_smgrcreate(&newrnode, forkNum);
> There should be a XLogIsNeeded() check as well.

RelationCreateStorage(), which creates the main fork, has no such
check. Seems better to stay symmetric, even if it's not strictly
necessary.

> Removing the check on RELPERSISTENCE_UNLOGGED is fine as well... Not
> mandatory though :)

I've gone back and forth on this, I can't really convince myself either
way. We might end up reusing init forks for 'global temporary tables' or
somesuch, so being a bit stricter seems slight better. Anyway, it's of
no actual consequence for now.

Andres



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Making tab-complete.c easier to maintain
Next
From: Amit Kapila
Date:
Subject: Re: Speed up Clog Access by increasing CLOG buffers