Alvaro Herrera <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq