Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions - Mailing list pgsql-hackers

From jian he
Subject Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
Date
Msg-id CACJufxGRSV3j6g7feEkfu7WuLx7ocMte8mvVEwNh7XBfnpJd-A@mail.gmail.com
Whole thread
In response to Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions  (Corey Huinker <corey.huinker@gmail.com>)
Responses Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
List pgsql-hackers
One more issue I found:
https://git.postgresql.org/cgit/postgresql.git/commit/?id=74c96699be3f53c058c8794c07952221b9625b4f
SELECT JSON_VALUE(jsonb '1234', '$' RETURNING char(2)  DEFAULT '011' ON ERROR);
ERROR:  value too long for type character(2)

Similarly, we can
SELECT CAST(text '1234' as char(2) DEFAULT '111111' ON conversion ERROR);
ERROR:  value too long for type character(2)

Composite types respect typmod, for example:
CREATE TYPE comp AS (a char(3), b int);
SELECT CAST('(14,42)' AS comp DEFAULT '(1234,2)' ON CONVERSION ERROR); -- error

The regression tests are too large; we can order them by the cast
source type's pg_type.type category,
so we won't miss any tests.

What do you think?



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: tuple radix sort
Next
From: Chao Li
Date:
Subject: Re: Reduce log level of some logical decoding messages to DEBUG1