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.94.2) (envelope-from ) id 1uoWq4-005PVC-JH for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Aug 2025 00:38:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uoWq1-000Btn-KZ for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Aug 2025 00:38:02 +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.94.2) (envelope-from ) id 1uoWq1-000Bsi-23 for pgsql-hackers@lists.postgresql.org; Wed, 20 Aug 2025 00:38:01 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uoWpy-000kjE-2Z for pgsql-hackers@postgresql.org; Wed, 20 Aug 2025 00:38:00 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-76e6cbb9956so2112224b3a.0 for ; Tue, 19 Aug 2025 17:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1755650278; x=1756255078; darn=postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=bjndFtGRsTRrTsFIetzkVpHo9brE6txorBGl848zoq0=; b=U79mmYMW3o/jBHYHBXju8n+S4qJagnraVVeREkTGZ7TXvGzWa0JGb80Bccp4UH/tNE It1AO5SkJc0giGcNjUHGTtfsQKYdNLQS9oxGjCpK3S9+6T0lNfchj5LxuNigjJBAiBhH Ibc7bc/oN4k0rOYbwyREoT4+oKoa+RDV6hPck= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755650278; x=1756255078; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bjndFtGRsTRrTsFIetzkVpHo9brE6txorBGl848zoq0=; b=QjtPLiPJQDMihoAxSuAdg90r45AzvQLiy2Lh1HcWlu+jZCZBpPSk/fPXTu3SAgU4E7 N1UTmGcH4FxNNPoiqtp5K5TrIN4vYjh3M5JZ0I41GSTiRibXnd8f+hAnvWaXMbf3HgYE /rd/NTQfAILvZ3yyQMYLYhmQ87NvExAe5PgnkGvlMZ3jCfK/IDRq5qa4dUfL6I8fisNv KbrnS0ZCdWiI//KRUJ6W5noKCaYNrrkDRloKUbvdGlfk7Ap/ZcCuoS+DYTL+q0jw5D5w KMuOXJ6T75MMtQ0ykYOI/xyKXQGDLLJaRQeRSj4dSJtNQAqLxc8uw84VXRTPEkIfsoIL G8Jw== X-Forwarded-Encrypted: i=1; AJvYcCWzTrHVenAGUXw1nP0j+AH9dQukZ5qwJFFPwH7X+E38p5fEjPL8wtWSheiEhU9b/vJ1SvFlMIeHfZEuAzBP@postgresql.org X-Gm-Message-State: AOJu0Yww6jJpFZK9U51tdlA39R/i/DIfNH8420G/dHkIQxpXG3VRjsBa ok6cCJ44mb6k5msutobiMIyjsKvoHrKxhoOgAc9BVhp7jmWexlD99R8r1jH/BiBbVg== X-Gm-Gg: ASbGncvtlBZMwK2hXvRaqoV0jjYa3tvNZvCdAKw774IMe0i1kh+msDc+tvANY1GjdeI sMnGHA5YsdAUDBhdkUXO3Frj62vNfT3nI+WmhXaPg+7ZezKfq1VfDNpBdxwiwEzlGH53kQ9WvwX 2uC2KwU+3dGaVSgmm1FJXao3ExC9OFkL1hXR25EbSHwWAy/BiTUBV7eaOELXCUYe7V6xvFuWAyx wQt3ydcjUk/ZH3BDOfASZczLTHuj0rWISD1Mfmq7zOGR9Qmaa6AOn6Q+q54l5O0PVZ+8imrsNHD 1YNZzRyKIn7Hwexjo2jMx8CC6A9ciEuO/V0Gh+Tn02jnuz6fEplPUe/xxYzuhL0a+K/HnjReAU9 pAXUiIY/M4lN7rKMwiRMD57+x8/ddCI+kcl2dP3Juh0QN1jwhF9V0pmt8a7/MKQ== X-Google-Smtp-Source: AGHT+IECf+uRs+MP6fLt1yw5w+OtBTa3As69dRvCJSASgh+BQQiZytQgTUOaHusBIcDy9Z6PHfpRNg== X-Received: by 2002:a05:6a00:4b0a:b0:758:b81:603a with SMTP id d2e1a72fcca58-76e8dc46dc3mr1487150b3a.2.1755650278430; Tue, 19 Aug 2025 17:37:58 -0700 (PDT) Received: from google.com (c-73-15-160-255.hsd1.ca.comcast.net. [73.15.160.255]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76e8ab7b100sm1421164b3a.40.2025.08.19.17.37.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Aug 2025 17:37:57 -0700 (PDT) Date: Tue, 19 Aug 2025 17:37:56 -0700 From: Noah Misch To: Heikki Linnakangas Cc: Andres Freund , Nathan Bossart , "pgsql-hackers@postgresql.org" Subject: Re: A few patches to clarify snapshot management Message-ID: <20250820003756.31.nmisch@google.com> References: <7c56f180-b9e1-481e-8c1d-efa63de3ecbb@iki.fi> <0cc21d6a-32c4-4d34-9eeb-7a0cf6dca9e8@iki.fi> <20250809222338.cc.nmisch@google.com> <217b1d29-a4e5-4b27-8a67-bbeaa20a5609@iki.fi> <20250819001436.38.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 19, 2025 at 11:45:01PM +0300, Heikki Linnakangas wrote: > How about the attached, then? It reverts the GetTransactionSnapshot() > change. But to still catch at least some of the invalid uses of the historic > snapshot, it adds checks to heap_beginscan() and index_beginscan(), to > complain if they are called on a non-catalog relation with a historic > snapshot. > @@ -1143,6 +1143,15 @@ heap_beginscan(Relation relation, Snapshot snapshot, > if (!(snapshot && IsMVCCSnapshot(snapshot))) > scan->rs_base.rs_flags &= ~SO_ALLOW_PAGEMODE; > > + /* Check that a historic snapshot is not used for non-catalog tables */ > + if (snapshot && > + IsHistoricMVCCSnapshot(snapshot) && > + !RelationIsAccessibleInLogicalDecoding(relation)) > + { > + elog(ERROR, "cannot query non-catalog table \"%s\" during logical decoding", > + RelationGetRelationName(relation)); > + } > + I feel post-beta3 is late for debut of restrictions like this. How about a pure revert, then add those restrictions in v19? Should be s/elog/ereport/, also.