On Tue, Mar 24, 2026 at 2:31 PM Zsolt Parragi <zsolt.parragi@percona.com> wrote:
> Hello!
>
> There's some inconsistency in deparse, it displays to_char for intervals:
>
> I also see a similar to_char leak in the error message - wouldn't this
> confuse users, as they never wrote to_char?
>
> postgres=# SELECT cast('2012-12-12 12:00'::timetz as text format
> 'YYYY-MM-DD HH:MI:SS TZ');
> ERROR: function pg_catalog.to_char(time with time zone, text) does not exist
> DETAIL: No function of that name accepts the given argument types.
> HINT: You might need to add explicit type casts.
The nearby v6 fixed these two issues, but,
src1=# SELECT cast('2012-12-12 12:00'::timetz as text format
'YYYY-MM-DD HH:MI:SS TZ');
ERROR: cannot cast type time with time zone to text using formatted template
LINE 1: SELECT cast('2012-12-12 12:00'::timetz as text format
^
DETAIL: Only categories of numeric, string, datetime, and timespan
source data types are supported for formatted type casting
The errdeatil above is not good and needs further improvement, since
timetz is a datetime category data type.