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 1p3yq9-00034O-A3 for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Dec 2022 12:20:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p3yq7-0003jE-O5 for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Dec 2022 12:20:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3yq6-0003i3-MK for pgsql-hackers@lists.postgresql.org; Sat, 10 Dec 2022 12:20:23 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3yq3-0005dA-Ik for pgsql-hackers@lists.postgresql.org; Sat, 10 Dec 2022 12:20:21 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 7E8F25C0116; Sat, 10 Dec 2022 07:20:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 10 Dec 2022 07:20:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1670674817; x=1670761217; bh=8 /UCbTdMYb4MrncjPJiqWZ3VcHKu9V5m7NyIIX/VEvc=; b=QKrt+mY89g8YYvHuP 3zh4JwlOgZmCHSZDm3KecgtoWlFOmCy68tymTq3Myd78k6HOkSDePEFIZczKO+lo Gc0mqGFoDWqKz4UlCiZVwvChAG3A+xgbwiEAzKKPUfQi82MgKmXXaT/hvj1uhYIF nFPMGy8ya+ymWC2Ws+KIjbolP686uCeIcYmRSZphtDPNlqt7AQcuzZF9kDcTSUEo O0SqfYdbO6rOqgFkG4Hzj4SWJaNHwxSQd0idIknMUuGvurEO0BP37H6sDm+jjQ7s y8DCRpi6gP6N9rVlV0ta2kyBHAJGWOx0le9oAuS9Wzy4hqCaEHBetU6lsE1NBiQX wU50Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeggdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Dec 2022 07:20:16 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C167DE98; Sat, 10 Dec 2022 13:20:13 +0100 (CET) Date: Sat, 10 Dec 2022 13:20:13 +0100 From: Alvaro Herrera To: Tom Lane Cc: Andrew Dunstan , Andres Freund , Alexander Korotkov , Robert Haas , "David G. Johnston" , Corey Huinker , Joe Conway , Nikita Glukhov , PostgreSQL Hackers Subject: Re: Error-safe user functions Message-ID: <20221210122013.swbpo63go6ty2fcn@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1181028.1670635727@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Dec-09, Tom Lane wrote: > I think though that it might be okay to just define this as > Not Our Problem. Although we don't seem to try to enforce it, > non-immutable domain check constraints are strongly deprecated > (the CREATE DOMAIN man page says that we assume immutability). > And not throwing errors is something that we usually consider > should ride along with immutability. So I think it might be > okay to say "if you want soft error treatment for a domain, > make sure its check constraints don't throw errors". I think that's fine. If the user does, say "CHECK (value > 0)" and that results in a soft error, that seems to me enough support for now. If they want to do something more elaborate, they can write C functions. Maybe eventually we'll want to offer some other mechanism that doesn't require C, but let's figure out what the requirements are. I don't think we know that, at this point. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Estoy de acuerdo contigo en que la verdad absoluta no existe... El problema es que la mentira sí existe y tu estás mintiendo" (G. Lama)