Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwIq5-0000FT-Dv for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 20:47:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TwIq4-0006Sp-92 for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 20:47:00 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwIq2-0006Sj-Qq for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 20:46:58 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwIq1-0002dg-AW for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 20:46:58 +0000 Received: from anarazel.de (p5DDC5936.dip.t-dialin.net [93.220.89.54]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0M2puc-1T75KF0WDW-00sWiz; Fri, 18 Jan 2013 21:46:45 +0100 Received: by anarazel.de (Postfix, from userid 1000) id D53311C0173; Fri, 18 Jan 2013 21:46:43 +0100 (CET) Date: Fri, 18 Jan 2013 21:46:43 +0100 From: Andres Freund To: Tom Lane Cc: Alvaro Herrera , Erik Rijkers , Kevin Grittner , pgsql-hackers@postgresql.org Subject: Re: foreign key locks Message-ID: <20130118204643.GA4359@awork2.anarazel.de> References: <20121129152326.69330@gmx.com> <20121129160220.GA4942@alvh.no-ip.org> <20121129161654.GB4942@alvh.no-ip.org> <20121228204847.GD4150@alvh.no-ip.org> <20130110210040.GB4110@alvh.no-ip.org> <20130118200204.GH4063@alvh.no-ip.org> <28623.1358541467@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <28623.1358541467@sss.pgh.pa.us> X-Provags-ID: V02:K0:eybyvBSBQTWvwgV9Q9znCXrc1fR68sWFGc3gYfebMA8 5yHBsLpxX25MEMk/PMkmVw1MxdwElqQ4FfVtj0Eg68XJicrp9P vFxTgiRAQfzYB0/uu869q7SCTGKGl7oem/BSSR4g91vXYsFvSY jeH6ZahFAerLi0GBhTL8gVh0SiWgb24eEFHdVT8w65p8aenjxw I5uZn6SHI0NVWqZO4UZpuuvbgxQ/A5Hlfpjp9x8mYcAvytfOKQ ZCDdeV7iUTkUCWMvSCnu/V8UeDNTiRswADE5D7GOfpFC/Zt1bl 8SPdL/q3auYidB+jbXI4GVkay1kv/FVYTFNnop7FarwNyC1p5r xCVHvgfXFy3n6MIJ+W+QIvwPEOgdrU1j5vegHc03D X-Pg-Spam-Score: -1.9 (-) 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 On 2013-01-18 15:37:47 -0500, Tom Lane wrote: > Alvaro Herrera writes: > > The reason is that there is an (unknown to me) rule that there must be > > some data not associated with a buffer: > > > /* > > * NOTE: We disallow len == 0 because it provides a useful bit of extra > > * error checking in ReadRecord. This means that all callers of > > * XLogInsert must supply at least some not-in-a-buffer data. [...] > > */ > > > This seems pretty strange to me. And having the rule be spelled out > > only in a comment within XLogInsert and not at its top, and not nearby > > the XLogRecData struct definition either, seems pretty strange to me. > > I wonder how come every PG hacker except me knows this. > > I doubt it ever came up before. What use is logging only the content of > a buffer page? Surely you'd need to know, for example, which relation > and page number it is from. It only got to be a length of 0 because the the data got removed due to a logged full page write. And the backup block contains the data about which blocks it is logging in itself. I wonder if the check shouldn't just check write_len instead, directly below the loop that ads backup blocks. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers