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.96) (envelope-from ) id 1whj1b-000NxA-0Q for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2026 07:18:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whj1Z-00BWKq-1p for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2026 07:18:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whj1Z-00BWKg-0w for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2026 07:18:22 +0000 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whj1X-00000000HSQ-3Eey for pgsql-hackers@postgresql.org; Thu, 09 Jul 2026 07:18:21 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 57C311D00087; Thu, 9 Jul 2026 03:18:18 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 09 Jul 2026 03:18:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1783581498; x=1783667898; bh=OKcJq9HnNapupLawmHJYmbJKER7AxFaI 9reEuE8F4Go=; b=A55iKll1JawcG/tc3Iho66TvEtIuv/oYHyY0a1KQCATRx/+6 IB00ZiA9fBYBG6m+GZvnYbf5Ppj9IKadXTVcHlFrCEVKI2zL9PUXqBb89Eh2Ujyg 412KysZd4B6ncn5WRUNoAePLatlJmMH2+sfGf0QGP0WjHxYenbOjDCgXGefMqGRD WfrsDNu1BaFi9+POFhykCS9e5TQhdXp+csZE3yw7+0Uhu4N1Xe8t7JvCk7LLBmx0 4Vq/tvnsy1kSDsO3D7NLwtUKf4uYjf4z2W7YKgphvXdzjyae6Y0/+dLpk9e+v2Kf mhe2DhvfFImSyS6HDDqYWBq6gHuopEMqjTr8+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1783581498; x= 1783667898; bh=OKcJq9HnNapupLawmHJYmbJKER7AxFaI9reEuE8F4Go=; b=T 98KYGnYIzjDz4x96VWtwpZOBJ+RYz7XibbAAsoP6IGtHYaQAWQ6zi5Zkpg1uWCC8 G5nlZV0MSzZAySQKHtfpX2nENOaBMzRw4PQePx+Ue10OOCnhSXQg+w7wpmwXdNWZ itVDrshWRlR0CO7KwRQ4crtOaRsbeZHOHbVu4ThJcdV1uonALYR8JWHJaOJpTkZJ nyZQ/JZIzFZhx1a0OUppbpxW/9y7XdJusRkKKjsGLN0sJ0TWxKQGA1PueIE8d8Nd KXrSJvwP+mrlFJQwHTyNPT6i4a/YSqRM6e0carHfa3CG8DAIHafnJKUxgkjj5i5o KnMySfoF3HpXb6TFfVbaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTECJDYcx8bGabhAcaEJtH0pEgsiioCAAK3QjcVQHtBW4hFpJqe88SR1iPN7OiCxTO 943FK+cRG82wquDFJZYw8qQwWS+MRxQ+Zqw086t/4YvwxKWXmMVgWBc7SUSXWw8qzO2xBq uy6G4W8b2DaB7xAEzRx0VlhKY2d4mbSEX4b4JDI7MOxM2zo1uWQr1wdjFbRocR4pUit4oe MC/03eZ22TV2qD4Qs4hfflmQPg3tFLoUloO89+MqwXQrU4PZ1BnSwkTkZWZQQPQrAW1Zc9 +V+U336MpPAgsZfJej+Bn+mk/jhC5lnx3a9qdmbtzUl9mZ2AoygcmwnC/CNS14eRhnu4b1 FCo9+Nym3cbz9NQ9VwxrvUOxjUw6MDu+SydwAwznYDWRXybvJArGC5C4znJLbiqVSCI3YL HpE3BeQ6+0anlziMl3lNCuqmweXeMqr/6+mjsyYURoxHd7KXJ7lU5PiE3VC6dLLnrrqJIi CSsGKiU8Lnd0d4jYP9otM/ki8GRhpsHc1p21iKSO2K2Ly4H49TujBDqFFUsNdR0bAb7JLr SgLVqgccx6AXO9bXe5UtvBDjVKIRDQ+mqQBNSHNy+uS7dHCLzMS6nOF1j5diB2rA89jZLv +Qb7WpLoHMGi8xcVE0/VzyHhYFoyIpX/2y4SDyHshngCBNSwngo6vTpEKq3w X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Jul 2026 03:18:16 -0400 (EDT) Message-ID: <33b9c141-dc4d-44a7-a1b8-9bd0a58cf954@eisentraut.org> Date: Thu, 9 Jul 2026 09:18:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: implement CAST(expr AS type FORMAT 'template') To: jian he Cc: Robert Haas , Corey Huinker , Zsolt Parragi , Vik Fearing , "David G. Johnston" , PostgreSQL-development References: <82b4223e-84d4-432d-8167-dd698ce489f5@postgresfriends.org> <1be5fcb4-683d-4ad0-b327-a34092e09504@eisentraut.org> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 04.07.26 03:09, jian he wrote: >> I don't really understand the purpose of this feature to begin with. >> You can already call the formatting functions directly. Does this cast >> syntax offer anything on top of that? >> > > https://www.postgresql.org/message-id/762ae707-7fdc-43d8-a77a-3a10d12ce21d%40postgresfriends.org > > After this implemented, we can begin fully supporting: > > ::= > CAST > AS > [ FORMAT ] > [ ON CONVERSION ERROR ] > The ON CONVERSION ERROR feature is independent of the FORMAT feature, isn't it?