Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZJkT0-00020s-5P for pgsql-committers@arkaria.postgresql.org; Mon, 27 Jul 2015 15:37:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZJkSz-00074N-Ns for pgsql-committers@arkaria.postgresql.org; Mon, 27 Jul 2015 15:37:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJkSi-0005lJ-Ca for pgsql-committers@postgresql.org; Mon, 27 Jul 2015 15:37:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJkSd-0000L7-F2 for pgsql-committers@postgresql.org; Mon, 27 Jul 2015 15:37:06 +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 t6RFapif027184; Mon, 27 Jul 2015 11:36:51 -0400 From: Tom Lane To: Heikki Linnakangas cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Fix handling of all-zero pages in SP-GiST vacuum. In-reply-to: References: Comments: In-reply-to Heikki Linnakangas message dated "Mon, 27 Jul 2015 15:15:15 -0000" Date: Mon, 27 Jul 2015 11:36:51 -0400 Message-ID: <27183.1438011411@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Heikki Linnakangas writes: > Fix handling of all-zero pages in SP-GiST vacuum. I'm a little bit uncomfortable with the way that this patch presumes that PageIsEmpty (a) is safe on an all-zeroes page and (b) will return true for such a page. Yes, it does work at the moment; but I don't think we are making such an assumption anyplace else, and in view of your other two concurrent patches, it doesn't seem very future-proof here either. I recommend that the code look more like if (!SpGistBlockIsRoot(blkno)) { if (PageIsNew(page) || PageIsEmpty(page)) regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers