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 1wfOmV-005Qhy-0u for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2026 21:17:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wfOmU-003AIW-0q for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2026 21:17:10 +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.96) (envelope-from ) id 1wfOmT-003AIN-38 for pgsql-hackers@lists.postgresql.org; Thu, 02 Jul 2026 21:17:09 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wfOmR-00000001Oxx-298F for pgsql-hackers@postgresql.org; Thu, 02 Jul 2026 21:17:09 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-c1276f8414bso280094166b.0 for ; Thu, 02 Jul 2026 14:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783027025; cv=none; d=google.com; s=arc-20260327; b=oZDqxBGhwHksPJBpWCYs6owhAsmWMaNzDTGHGUH4RaMMIsVd2wdj2cvYRn9s9t7zlN 1MBe/BB3MnRUqT/mQLBTZhdAPL9Ho21KpZjsXVTc2bMixLHvw8ZnyWowQGqAfl/v8AT0 4hb2zX/TFkWfrgBePXtm+NrbyK+ZZBl/+ouiPIrX+fYdPO6wq2/IALg4GE7nQeEpDnyI rWj9+7YQievnz38Y8u5mjluJPGRAb5KGIamm2wUif8Z1YCFTviuM+3+BEy/QigoZavRy RIKDpvBbgcJDI5YbuKRCOjI4FQfFhKF7AuktkXk+JWzLm9icAwNMfMotVjd/FtKujFDP o8UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Y9XN3/CySLTdYlDxvxaWzc3HVvNvXhtMOZKfucZeElE=; fh=v7ueo/TcEDZVr+5JUn5t0ZI33bNyyTa1NMvbN28Jlxs=; b=jozID0rhfAxWldCRfWjHXMC7EZSponQIk7BHuwXm+vzKNRzMY3dAKbQ4SE3DsRk2fw 8ld5EzFcHx2p1T6nw53V7sgHE5PupaUzki4lIYUyxdI1aTggk5Uxg5njOi2kiuWIUrCJ 8QGiaJnpGYpJOe/EwN3m2ESMvnx2RoAn1X8IMDiFAOHhOEWsaM57J5zkEve2kPIW0e7v HnbXCczTS+0mF74xf3KHMoQr5gCpF629auROXToaazZ1glfCR9J1oQuwiRCbf1SmKCSY s17sVpMMXJ+gFHgiyMc1QDfTTNrITO25hGmhXod5a6om8Ap2tn6Gs5qcfxEAvXOzEDKR Ov/w==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783027025; x=1783631825; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Y9XN3/CySLTdYlDxvxaWzc3HVvNvXhtMOZKfucZeElE=; b=Meuc69VGzswx47BZp6FgYX0p0t1J1bmpNnkRZbd4w5gHDTJPbU5oUKp48u7m7HdMRW UqOQDgFnIuxVsZdrQQnx2UEfc4Lw+01a+w60fE+piADoRwpONbqZlHhl0xF7zTsmYWpt I5udPFUagqfb65hox6nmRpHdX+Dh2fxEGN6jx8DSlIM3rLaN4XUA03t2IHrzBNNAC6JJ VyF53ZyiYwfXZxoJciuqCyBFan/9gGrW71tcz6TQN0Ck9+uMWgZ513GxICtKD/4WMw/l Pm91HgLiVwMsYYDd/6mBLDm/wz9tcRAsrmZgmpr4xBiqWloTK7YfgrxGowvgeuz7C8Va G2pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783027025; x=1783631825; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Y9XN3/CySLTdYlDxvxaWzc3HVvNvXhtMOZKfucZeElE=; b=SXPw3+FvzWtR84uaXnnDyMf3Kx3n/GIKaWU+qUYgJyk11TxCHaMx6JsEAjpvR5m/CK e46knOJJaOIP/bUztdnqHNaSN39E4YLOKErjdU3x/IDcMzEos//5nJWi+DaKy6cl+glV mnghtqPVY+jvu3aZ5TbW55QP0droNWySRsz1x5rhWIB/IAruxOCIDG1S/YXIhvi9kJtd 8WMfxe1zDvquolsrfRBOXv7IUBE85BwhHHxq5iKh2FzQX+ooPzYORKm7Lp+K59kaQCDo 4KIDppuH/t2Nmpp5DLUvCb3J88sKB5Itp+6IWEFckozc08/GvnQg7QpEwCsjU25vfS84 ivxQ== X-Forwarded-Encrypted: i=1; AHgh+Rr/mnxSEw3RUl6aKc/RF7YS76pYrLL7VqBkTTpIxpWhstzkIRmuoZ6rsih7P1FtB4EXBgDsmnfxW9gOFY2o@postgresql.org X-Gm-Message-State: AOJu0Yz+4ZLkteW2OauGUGlcnCY3crTKvylU6zs0JUgjEMNbCEGG+Znf QMhEzIygBPT/+E50VO4jEXJnIKJ3cCsjuBW9APifm3weSqWmUek5BEielW5JxMDffH5eIbudwsP c8cDocgPxcV0RDfkznn22BgcS+kZ+aCw= X-Gm-Gg: AfdE7clBr4dmvjcV5pPujxx8m78pkpGeiEJB5duFULUYlBzJJy0rq9FWt9xmBxa+/23 +yHUbw/XVlrMtRpnWUdddtVFB30OU5zoAZZGBF57FI89d7H9yBR2XrOhp43HslhMIMAiScBHppi LDwR0aHQzV6d2C+mdWFUeTzuQvOclL/UhXzjXuaoKOYxU5DKn1elagvv7fEs+BuBChbfILm1Eel nUamHNP3NlNPNzsnBqR7Z+pjbVweiEdJubZ0rWSdO943pn+b3YnrQhcJxoI4BH8GzlpILTPivH/ LSToASPJX3i0rZh3zuXLNI4NBR5REb8y6hOCbDM= X-Received: by 2002:a17:907:3f85:b0:c12:29a3:e348 with SMTP id a640c23a62f3a-c12aa130c40mr387079466b.27.1783027025247; Thu, 02 Jul 2026 14:17:05 -0700 (PDT) MIME-Version: 1.0 References: <4c358bf8-87e8-4760-83d5-a6f9fcd88907@postgresfriends.org> <1b702de4-86b0-4144-a2d0-38266296894f@postgresfriends.org> <82b4223e-84d4-432d-8167-dd698ce489f5@postgresfriends.org> In-Reply-To: From: Robert Haas Date: Thu, 2 Jul 2026 17:16:52 -0400 X-Gm-Features: AVVi8Cd9DCQ0KBnteioW4eK8vgdcBAWtJzgt7Wox9-v4a6QEnsHDYhkU6uxRkjk Message-ID: Subject: Re: implement CAST(expr AS type FORMAT 'template') To: "David G. Johnston" Cc: Haibo Yan , jian he , Corey Huinker , Zsolt Parragi , Vik Fearing , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jul 2, 2026 at 4:51=E2=80=AFPM David G. Johnston wrote: >> and the existence of a >> format cast doesn't mean there has to be a regular cast. > > Disagree OK, but on what basis? If I want 'whatever'::thistype::thattype to fail and CAST(thistype AS thattype FORMAT 'bumble') to succeed, then I need there to be a format cast but not a regular cast. Apparently, you'd like to arbitrarily disallow that case, but I can't see any logical reason for such a prohibition. Essentially we'd be forcing the user to create a regular cast that they don't want in order to be able to create a format cast that they do want. If there were some reason why we had to couple the two things together that way, that would be one thing, but as far as I can see, there isn't. -- Robert Haas EDB: http://www.enterprisedb.com