Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vcnxK-00AzcA-2c for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jan 2026 17:01:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vcnxI-0032dV-2u for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jan 2026 17:01:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vcnxI-0032dL-02 for pgsql-hackers@lists.postgresql.org; Mon, 05 Jan 2026 17:01:21 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vcnxH-004MKJ-0u for pgsql-hackers@postgresql.org; Mon, 05 Jan 2026 17:01:19 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id C4F4E7A00B6; Mon, 5 Jan 2026 12:01:17 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Mon, 05 Jan 2026 12:01:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1767632477; x= 1767718877; bh=bp9DPm64plCSvjw1nd4wd3CV8zv4hLicUK+WDkgC5Gw=; b=M +tjdA0XxrW9bxJRdHKvR4rAncm112h876n67i4MarUFD/d9m87nVPsYsZN6ET2jo xTcG5ihc+JDuNz2CXY19iURbtyzCYWwnCUM+hTPyZqH6YtMgDhYuluaywNyzlov9 Clu+/44aPGHQyhr6WvUU0wZyB8A6y5k5UC16u81I80/99VsrslEaG+LJvupXQ+3W OqyUfJV4LGRDbL22oPdiawbhzbgWP9WMA6Ly4R1OZB0yr+juUosaupE+vYKl1eWz llpi/2qPEAUMdXZJghqN9MNZVlkc3dPrZV8uwTts1IR5X4Cav08auD67y5LH7zjY Sc5oCNdq5kqiIGqgBWa0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1767632477; x=1767718877; bh=b p9DPm64plCSvjw1nd4wd3CV8zv4hLicUK+WDkgC5Gw=; b=nygRLqo45bQAEcyen 1sjSmtzZ7GTKpcAXSIbI+/BbSx+xyerixFjySYSi/GespsmoOsF/dMmqEDcilpth NYFa7vpPQZM8dMA+KULWdDQHr4Ytj67GbjiG8Dv4IpI1u2VqL8yJoZFb6KSmwa0b Bp0ymLNFCXMwViPraoRjswDmwHWTI2cgXR6oE+JIrvnEP5vHB1xgKRyxQ3KeIFR5 S1rIfkMq+yjV0WF3uXbQ1iJ2UbDoke4n+aaCbvl89GjHk+ZhO4n+ny4fKvTmduDv zJe2Bzh1rcdqls/ybB2IZZ/SoCK6GNwUvLNNmFu/BsFWIRG27XJrhLzTy+vK9o5Y afHeg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeljeekhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepteeuvdehffekvefgueehveetveekgfegtddtueefueehuddutdfhfeff hfejfeffnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges khhurhhilhgvmhhurdguvgdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheprghnughrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtohep lhhirdgvvhgrnhdrtghhrghosehgmhgrihhlrdgtohhmpdhrtghpthhtohephhhlihhnnh grkhgrsehikhhirdhfihdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhs thhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Jan 2026 12:01:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1767632472; bh=o46sXmpOc3JqjbqpmnM3o6AQEGl7sAYGdU720AXTo0Y=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=L/PB5J9zGoF3D81yN/gF6GMIHABvVeXGagR7IqtxQXVswYnAiAPAkBVay9jX8ceRX /5FGDxjcSz00bQAS6YpLvJfYR7nq/S2X6j9ip4e1unwqXNFf7xwTXW0dA77rl9nUZF aThwQRne7kQ8WYjmVqx7bld/+A+5NO8flGp7I1C9DYR6GwevoDMbucIrb1USUd2KzH NuD95IL/NKGudWb93T6dIdYWm0MlGv9JJZGGW3mRWbdsebNGq4vg+euALzB/C/qco8 gqVbow5Py6qNjlSbhfKbcWiGg2mct+XsQ5OKmytjUJytpEP464XFQbtL7+uDmEGC59 vemYo9SuzNRlg== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 4B74B7B; Mon, 05 Jan 2026 14:01:12 -0300 (-03) Date: Mon, 5 Jan 2026 14:01:12 -0300 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Heikki Linnakangas Cc: Andres Freund , "pgsql-hackers@postgresql.org" , Chao Li Subject: Re: A few patches to clarify snapshot management, part 2 Message-ID: <202601051648.6qlcg46owpjm@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5ed502dd-2b42-4139-99e4-c34e7396afaf@iki.fi> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Dec-22, Heikki Linnakangas wrote: > @@ -146,7 +146,11 @@ find_inheritance_children_extended(Oid parentrelId, bool omit_detached, > Snapshot snap; > > xmin = HeapTupleHeaderGetXmin(inheritsTuple->t_data); > + > + /* XXX: what should we do with a non-MVCC snapshot? */ > snap = GetActiveSnapshot(); > + if (snap->snapshot_type != SNAPSHOT_MVCC) > + elog(ERROR, "cannot look up partition information with a non-MVCC snapshot"); > > if (!XidInMVCCSnapshot(xmin, snap)) > { I think this code should be skipped when a non-MVCC snapshot is in use. I assume you won't hit the case unless you test for it specifically, so I'm not surprised that just adding an elog(ERROR) does not cause visible failures; however in production it probably would. And looking up partition info in that case is, most likely, useless. So changing the 'if' test if (!XidInMVCCSnapshot(xmin, snap)) to only do this dance if "->snapshot_type == SNAPSHOT_MVCC" seems reasonable to me. I'm not sure what's a good way to verify this, however. We would need a test that adds partitions pending detach to partitioned tables used by as many other tests as possible ... (Maybe: have test_setup.sql add an event trigger that runs on CREATE TABLE, detects PARTITION BY, and creates and partially detaches a partition. Not sure how feasible this is.) -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/