Re: xlogdump fixups and WAL log question. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: xlogdump fixups and WAL log question.
Date
Msg-id 5664.1161533524@sss.pgh.pa.us
Whole thread Raw
In response to Re: xlogdump fixups and WAL log question.  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: xlogdump fixups and WAL log question.  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Simon Riggs wrote:
>> I think it is possible to detect this case without making catalog
>> entries, so I'll give this a try. Methinks that the truncate *must* be
>> the immediately preceding command, otherwise we might have a trigger
>> executing to put rows back into the table before we COPY.

> Hmm, is it possible to save the "is empty" info somewhere in local
> memory, perhaps the relcache (not necessarily propagated), and have
> heap_insert turn it off?

The relcache isn't a very safe place to store state --- it's a cache,
not stable storage.

However, I don't understand why Simon is on about "empty".  ISTM the
important state is "new relfilenode assigned in this transaction".
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: xlogdump fixups and WAL log question.
Next
From: Tom Lane
Date:
Subject: Re: estimated_count() implementation