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 1q9mv2-0004vA-VB for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jun 2023 13:21:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q9mv1-0007dw-TB for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jun 2023 13:21:43 +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 1q9mv1-0007dg-Jx for pgsql-hackers@lists.postgresql.org; Thu, 15 Jun 2023 13:21:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q9muy-002XGJ-Rx for pgsql-hackers@lists.postgresql.org; Thu, 15 Jun 2023 13:21:43 +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 35FDLc4a2111926; Thu, 15 Jun 2023 09:21:38 -0400 From: Tom Lane To: Yura Sokolov cc: pgsql-hackers@lists.postgresql.org Subject: Re: When IMMUTABLE is not. In-reply-to: <389c986d-fbb4-c644-9280-db7836af7ca9@postgrespro.ru> References: <389c986d-fbb4-c644-9280-db7836af7ca9@postgrespro.ru> Comments: In-reply-to Yura Sokolov message dated "Thu, 15 Jun 2023 13:22:28 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2111924.1686835298.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 15 Jun 2023 09:21:38 -0400 Message-ID: <2111925.1686835298@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Yura Sokolov writes: > I found, than declaration of function as IMMUTABLE/STABLE is not enough = to be sure > function doesn't manipulate data. Of course not. It is the user's responsibility to mark functions properly. Trying to enforce that completely is a fool's errand; you soon get into trying to solve the halting problem. I don't like anything about the proposed patch. It's necessarily only a partial solution, and it probably breaks cases that are perfectly safe in context. regards, tom lane