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 1ueCNR-006J3i-IW for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Jul 2025 12:45:50 +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 1ueCNP-007VSw-SY for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Jul 2025 12:45:48 +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 1ueCNP-007VSo-IB for pgsql-hackers@lists.postgresql.org; Tue, 22 Jul 2025 12:45:47 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ueCNM-000EDI-1j for pgsql-hackers@lists.postgresql.org; Tue, 22 Jul 2025 12:45:47 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id EA32843899; Tue, 22 Jul 2025 12:45:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postgresfriends.org; s=gm1; t=1753188343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/cvVIGuK6ZcMFFI5J7dO6hm8cozr4xHaG7nN3gz1FpY=; b=MBoReJHgjETsqEiVyXePT9tEoixJGUHrpZQVpbEHaN2ofzyqfpIssnby2/dPw6Gmlc6NoE 1Yr6vRIqo0C0WegDbpocXYKASX2PD+XpcMGP/FqYdYrYHdOVt0MkCoEbCQxoh8fat129ik 2ZZSsHcSsu8vAKPnJU68MBFfjB5c0OcDAPGJs9yjHcOKZyUOT1dA3k9u3/qCnVD4SQdNw9 1m/z78/hlb1ED7OYJa9EGpIbBwuImeIr0N4nbyfnSpDzzYh7UBDmR050nSW9qmIyD23Rf8 B/G+24qBET8pRy2qxECIb/VGpRTLI0RuanhH4THmeD3/pr/oC2rBGjO9hLGusA== Message-ID: <4c602ca2-2c1a-420c-bbf2-906d65c93e77@postgresfriends.org> Date: Tue, 22 Jul 2025 14:45:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions From: Vik Fearing To: jian he Cc: Corey Huinker , Isaac Morland , pgsql-hackers@lists.postgresql.org References: <04afcd1f-ed7d-4c0a-add1-50e3719ccbf9@postgresfriends.org> <762ae707-7fdc-43d8-a77a-3a10d12ce21d@postgresfriends.org> Content-Language: en-US In-Reply-To: <762ae707-7fdc-43d8-a77a-3a10d12ce21d@postgresfriends.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdejgeelfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffhvfevfhgjtgfgsehtkeertddtvdejnecuhfhrohhmpeggihhkucfhvggrrhhinhhguceovhhikhesphhoshhtghhrvghsfhhrihgvnhgushdrohhrgheqnecuggftrfgrthhtvghrnhepvdevhfehuefhuddtuefhhfeihfdvgeegvedvveffhefhveffuefhkeefvdeuieevnecukfhppedvrgdtvdemkeegvdekmeduudgvtdemvdejtddumegrgegvudemgedvfhegmegrlegrkeemkegvieeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemudduvgdtmedvjedtudemrgegvgdumeegvdhfgeemrgelrgekmeekvgeikedphhgvlhhopeglkffrggeimedvrgdtvdemkeegvdekmeduudgvtdemvdejtddumegrgegvudemgedvfhegmegrlegrkeemkegvieekngdpmhgrihhlfhhrohhmpehvihhksehpohhsthhgrhgvshhfrhhivghnughsrdhorhhgpdhnsggprhgtphhtthhopeegpdhrtghpthhtohepjhhirghnrdhunhhivhgvrhhsrghlihhthiesghhmrghilhdrtghomhdprhgtphhtthhopegtohhrvgihrdhhuhhinhhkvghrsehgmhgrihhlrdgtohhmpdhrt ghpthhtohepihhsrggrtgdrmhhorhhlrghnugesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-GND-Sasl: vik@postgresfriends.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 22/07/2025 14:26, Vik Fearing wrote: > The is: > > ::= >     ERROR >   | NULL >   | DEFAULT > > but I am planning on removing the NULL variant in favor of having the > be a .  So > it would be either ERROR ON CONVERSION ERROR (postgres's current > behavior), or DEFAULT NULL ON CONVERSION ERROR. Sorry, I meant . The point being that CAST(ARRAY['1', '2', 'three'] AS INTEGER ARRAY DEFAULT NULL ON CONVERSION ERROR) will give you (CAST NULL AS INTEGER ARRAY) and *not* ARRAY[1, 2, NULL]. -- Vik Fearing