Re: implement CAST(expr AS type FORMAT 'template')

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Haibo Yan <tristan(dot)yim(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: implement CAST(expr AS type FORMAT 'template')
Date: 2026-07-03 09:49:46
Message-ID: CA+TgmobHVgxxof4n6s2yRG-bu_mHpbxWwXkPvinHhkJry_up3A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 3, 2026 at 12:09 AM David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> I'm not sure how to make the design less problematic: format is optional, and for casts that need a format to succeed they provide a default.

But that's not how casts work today. some_date::text shares neither
code nor behavior with to_char(some_date, 'some_built_in_constant').
It's completely separate. We're not going to rethink the basic design
of casts for the sake of CAST(...FORMAT...).

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Shlok Kyal 2026-07-03 09:48:02 Re: Support EXCEPT for ALL SEQUENCES publications