Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgrUp-00051L-Bz for pgsql-bugs@arkaria.postgresql.org; Wed, 12 May 2021 16:14:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lgrUo-0006V3-AP for pgsql-bugs@arkaria.postgresql.org; Wed, 12 May 2021 16:14:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgrUo-0006Uv-3i for pgsql-bugs@lists.postgresql.org; Wed, 12 May 2021 16:14:02 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgrUm-0001Z2-4p for pgsql-bugs@lists.postgresql.org; Wed, 12 May 2021 16:14:01 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id B729312D6; Wed, 12 May 2021 12:13:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 12 May 2021 12:13:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm1; bh=h G4t4v7UNPYs2/4giBKR4cmiR8gPZJpoFu3A8C5smus=; b=JQM0p1T3o2VHHHRoI rgF+IVD2Do8K8qQk61AKsy4Twq/jSPj7U96pIlJ9JzJwh6XuyuyTmBTtPPROjZuD 5V0S+2848D8HV8IWCEJVTzxIHtiAj9qXffdHOtYZVKYwD/LIudeFnqzbPO0z+z3v 15l4o7Cry7PyWtJBvIfOeNF9AsIm96GL7mPdpeKYdfKFB12fFogsyQggypcWKrMi jK6luKhvjbmOb8g945JjRnKTuU+GMnfvgJ2Tw/QkLlHeBhF+tP/fG956yA1DR1RU YIEIFpzrUY3k6Glccv7/OsGBt9papm3/X0RaDStY6bf9HMLsVkTTmU+DPULWLcs8 3zI8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=hG4t4v7UNPYs2/4giBKR4cmiR8gPZJpoFu3A8C5sm us=; b=ZmQHvCORBZiNIC1qN0AH/F1sWdA6Kp9Pz0xgE45P3gPzm3T18b7busavl T/pWuvTAfb52EF1+t5ZeuSnFi2Lr2KA9/NoWsqFJ0jCrCaMroF+gnqseJo1hED0t tngPh13IGkm7e3rzePd+MOKLWioIOeUw/aqVNv+2wTXaT5zNY5+Hz5/Bi3A+4K45 PQ1fPFP5EujDe5+Wbw7AqbkIfhXrO9tdsCgfBGU2/tz/GfXtkLT4fD3wL4MdqFEt Y2guVHD12DvKih/h/z2p3xuQw3ouJK+xe5BBKNwL8cRwGYHwVvUHxuVX5sZd+vFc sym8+RnFM1QnZy2DxAYs1tI2KrH9g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehvddgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtugfgjgesthekredttddtjeenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepieduueejhfeufeffffffkeeitdfhleeuffeulefhkeehueejffefgffh ffffteffnecukfhppedutdejrddugedvrdeffedruddtfeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghl rdguvg X-ME-Proxy: Received: from intern.anarazel.de (107-142-33-103.lightspeed.sntcca.sbcglobal.net [107.142.33.103]) by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 May 2021 12:13:55 -0400 (EDT) Date: Wed, 12 May 2021 09:13:54 -0700 From: Andres Freund To: Tom Lane Cc: Alvaro Herrera , Robert Haas , a.wicht@gmail.com, pgsql-bugs@lists.postgresql.org, Peter Eisentraut Subject: Re: BUG #15990: PROCEDURE throws "SQL Error [XX000]: ERROR: no known snapshots" with PostGIS geometries Message-ID: <20210512161354.6msdekb4chsmpceh@alap3.anarazel.de> References: <15990-eee2ac466b11293d@postgresql.org> <20190904105618.j5l6fhyesmprmstf@alap3.anarazel.de> <912290.1620774094@sss.pgh.pa.us> <957186.1620784871@sss.pgh.pa.us> <1032535.1620789957@sss.pgh.pa.us> <1097541.1620833866@sss.pgh.pa.us> <20210512155153.qb6dpsg56doicg57@alap3.anarazel.de> <1099600.1620835210@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1099600.1620835210@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-05-12 12:00:10 -0400, Tom Lane wrote: > Yeah, on further thought, the real question to be asking here is > "what's protecting that in-flight datum from becoming a dangling > pointer?". AFAICT, the answer right now is "nothing". Therefore, > it is *never* okay for plpgsql to be executing without a registered > transaction snapshot; and it seems quite unlikely that it'd be any > safer for any other PL. A bit independently of this concrete issue, I wonder if we could make it easier to detect such bugs. If we somehowâ„¢ associated an xmin horizon with toasted datums, we could then assert before dereferencing that we still guarantee that such a reference is still valid. The "somehow" part obviously isn't entirely trivial, but it seems we could hack it by encoding it as a different vartag? Greetings, Andres Freund