On Mon, Jul 6, 2026 at 11:56 PM Haibo Yan <[email protected]> wrote:
> I now think my v2 patch is too broad.  It tries to make CAST(... FORMAT ...)
> a generic user-defined format-cast mechanism, but SQL feature T839 is much
> narrower: formatted casts between datetime types and character strings.
>
> So I think the next version should move back closer to Jian’s original scope:
> support T839 first, rather than introduce pg_format_cast and
> CREATE FORMAT CAST.  I still think we should avoid ad-hoc parser rewrites to
> specific function names, but the feature scope should be the standard
> datetime/string cases, not arbitrary source/target pairs.
>
> I also think it would be useful to retitle this thread around the standard
> feature, for example:
>
>     Support SQL feature T839: formatted casts between datetime and
> character strings
>
> That seems to describe the real target better than a generic format-cast
> facility.

My current point of view is that your patch does exactly the right
thing but it's not clear whether we want it. I mean, if we eventually
want to support this feature with arbitrary types, there is no reason
not to do so from the start. Or at least, none that I can see. But
that does not address the question of whether we want the feature in
the first place, which is debatable.

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


Reply via email to