Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDFeE-00037L-NZ for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2015 17:30:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZDFeD-0007Cw-4P for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2015 17:30:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZDFby-0004pM-W9 for pgsql-hackers@postgresql.org; Thu, 09 Jul 2015 17:27:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZDFbw-0004B7-Bl for pgsql-hackers@postgresql.org; Thu, 09 Jul 2015 17:27:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t69HRhbZ022785; Thu, 9 Jul 2015 13:27:43 -0400 From: Tom Lane To: Fujii Masao cc: Andres Freund , Martijn van Oosterhout , PostgreSQL-development Subject: Re: WAL logging problem in 9.4.3? In-reply-to: References: <20150703060137.GB20285@svana.org> <28320.1435935120@sss.pgh.pa.us> <20150703164931.GI3291@awork2.anarazel.de> <20150703170229.GJ3291@awork2.anarazel.de> <20150703172605.GM3291@awork2.anarazel.de> <27532.1436195680@sss.pgh.pa.us> <20150706152123.GK8902@alap3.anarazel.de> <28415.1436197794@sss.pgh.pa.us> Comments: In-reply-to Fujii Masao message dated "Fri, 10 Jul 2015 01:52:36 +0900" Date: Thu, 09 Jul 2015 13:27:43 -0400 Message-ID: <22784.1436462863@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Fujii Masao writes: > On Tue, Jul 7, 2015 at 12:49 AM, Tom Lane wrote: >> One idea I had was to allow the COPY optimization only if the heap file is >> physically zero-length at the time the COPY starts. > This seems not helpful for the case where TRUNCATE is executed > before COPY. No? Huh? The heap file would be zero length in that case. > So, if COPY is executed multiple times at the same transaction, > only first COPY can be optimized? This is true, and I don't think we should care, especially not if we're going to take risks of incorrect behavior in order to optimize that third-order case. The fact that we're dealing with this bug at all should remind us that this stuff is harder than it looks. I want a simple, reliable, back-patchable fix, and I do not believe that what you are suggesting would be any of those. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers