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 1whj3j-000NyH-32 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2026 07:20:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whj3i-00BYLJ-1Y for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2026 07:20:35 +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 1whj3i-00BYLB-0i for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2026 07:20:34 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whj3g-00000000HUB-3twT for pgsql-hackers@postgresql.org; Thu, 09 Jul 2026 07:20:34 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 7A17C7A0132; Thu, 9 Jul 2026 03:20:32 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 09 Jul 2026 03:20:32 -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=1783581632; x=1783668032; bh=TIlRqL/p1cWWM1a1cU3VLGBYEvH5CJvV I1a+Hqaj454=; b=jlGfpLrD0Eo3/aOG9mLoroITrkJWL4teXnyZLrJrUzPpbjkT GcechihT9St95Uphk0HYHJOKkmm6hbt9oeEzmai7tM9zO2ROjifvNyek8qx/Wmpf tSQ/dfZrEWdHqQ5brMpzZk5jNcofnD3zUurmvEupmSAZJ7DFA/i42vdCHM2w/mpj usqscGpw7Xvg65ak9RPgdmnrc8MlxR2Oawh1Y5QApHPN/xJ3+g6CFxiWbA2y14oO KQYvgdUFkopyDa8T4RJkE6uyVGSTPg3VW4IF3xpVsEkGN6XVBwmX6U/jDmVb+6SK CrTEeuxr8+px5C6gmhRXGT+6T3nKF0IrdiUWCw== 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=1783581632; x= 1783668032; bh=TIlRqL/p1cWWM1a1cU3VLGBYEvH5CJvVI1a+Hqaj454=; b=k uj3sH1iZzZAiPpApQm3X6ebalTD9c/8Sa6Ki8f+Hwfih1QoU3Nt0WWgGcNX/ftDc RsdZRiO82BXhqNY8Mf988ETcv112J/QyI5ZfQWsFKauu5Bpesa/JlKH67CUJzc83 wPJd9cuvqSw/WPQE7KV56/lbNyOdI6HxtyRHpAXiYHG5MxtP40Zxee+4mdlWxBZ/ OkBFUcvrXrHXqn4xan438kye31Q1Ub9S6gD3I5d+/3TLeomqEwgRz5SZUWZpfqBb HbGerQllJ5DgbWXgJcBFiAPkS3s3FuLxLh8LzIq5Jw+s/vCm8TDPji6I46zccePf c+INn4ZgWRjc3cGwj/7Ug== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEO/3U3W77LGFVRWK9jnxzT7eD2KgD2OFFNcMTPqdzdehXmv0DOy6AneXfbNeen3g 2//T5Qov/3qKOaJAEaM/riyU+j28/pPjLaNhS+wbwblPiLdC9kQmg+2v0nZEwu977H6nru 7CdmwCRZuvnb0AygzQldgLdsfGsgmj2JgdtkQrP02gfKDKaaWUGhFcAm3dy2GNm4BAIP1+ Fzg9TD4vocDVomiW7wYqKLKkob9YEgCmvMqIfIFbIgXeE4cXIJHrcehmz7me4Gh28IYsXi aEFa7MJRsN+aermDkwKapcSD9P5DZBx8tQmL+zaZOlsBvy+E0b1+hS1CQnpvg1Y+Bb+njW oVeXJB0dk5ExrqOkuJS0akoLsK30+AW4JXGBiWSZHTwhTXIixrF1RwQmpHWbNzdI6ujDpa gR1/qyie8uAZ3Q967YNPvMKSD1NQKN9gofWijpjPZoCGsm8Q+aGqUPy6DpJ131pcywpEE6 rmZRL1NfhtEv4GmJ2S+cryj0sH32LY/lH841fzyREVhl1u7okic2gS85i1AyHHtfc7NS5M gGSwEcqTMBfaQuIDNrBNIBZVyskrKFi4BbKJRFfaxUcYgfOc16sbxMw3zgMWfYWz9NCCXG u4kfCywxw8v532b8Y+KWKNB/qsjXDsM8yCSwTs5gkg9DB7FVsyktzS9DwnUg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Jul 2026 03:20:30 -0400 (EDT) Message-ID: <488d3554-0564-443e-b08a-66e0da66f736@eisentraut.org> Date: Thu, 9 Jul 2026 09:20:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: implement CAST(expr AS type FORMAT 'template') To: Haibo Yan Cc: Robert Haas , Corey Huinker , jian he , 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 06.07.26 19:14, Haibo Yan wrote: > The cases where I think a generic mechanism could be useful are > broader than that. For example: > > text <-> date/time using datetime templates > text <-> numeric using number templates > text <-> bytea using hex/base64/escape > text/bytea <-> extension types > using external representations such as > WKT/WKB/GeoJSON for geometry types One problem I see is that this would dictate that there is only one possible format language for each of these conversions.