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 1tMZpQ-0055qQ-9i for pgsql-general@arkaria.postgresql.org; Sat, 14 Dec 2024 21:37:36 +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 1tMZpN-0074L1-Ij for pgsql-general@arkaria.postgresql.org; Sat, 14 Dec 2024 21:37:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tMZpN-0074Hh-7B for pgsql-general@lists.postgresql.org; Sat, 14 Dec 2024 21:37:34 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tMZpM-002rtD-AJ for pgsql-general@lists.postgresql.org; Sat, 14 Dec 2024 21:37:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4BELbUmG1472144; Sat, 14 Dec 2024 16:37:30 -0500 From: Tom Lane To: Ron Johnson cc: "pgsql-generallists.postgresql.org" Subject: Re: Allowed to return possibly TOASTed datums? In-reply-to: References: <20241214142827.fa730433d412246d424436e3@magnetkern.de> <1387150.1734195709@sss.pgh.pa.us> Comments: In-reply-to Ron Johnson message dated "Sat, 14 Dec 2024 13:13:55 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1472142.1734212250.1@sss.pgh.pa.us> Date: Sat, 14 Dec 2024 16:37:30 -0500 Message-ID: <1472143.1734212250@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron Johnson writes: > Since the purpose of TOAST is just (I think) to store "large field values" > on disk by dividing into multiple chunks, what would be the purpose of > returning the TOASTed value to Jan's function? Probably not much. There are scenarios where not detoasting saves work overall, because the object never has to get detoasted; but I think that's rare. It'd probably look like UPDATE t SET c = no_op_function(c) WHERE ... which is something few people would write. regards, tom lane