Xnerv Wang <[email protected]> writes:
> In the attached v3, pg_input_is_valid_common() uses parseTypeString()
> to resolve the type name on each call. It caches only the type's input
> function and looks it up again when the type OID changes. The
> typname_constant flag and the get_fn_expr_arg_stable() check are gone.
Pushed with minor cosmetic adjustments (mostly the comments). I left
out the test cases though; couldn't convince myself they were worth
memorializing given the simpler coding.
BTW, Andreas wondered why pg_input_is_valid() doesn't take a regtype
argument. I think the reason is it wouldn't pass the typmod through,
so we'd lose the ability to test cases like
regression=# select pg_input_error_info('abcdef', 'char(4)');
pg_input_error_info
--------------------------------------------------
("value too long for type character(4)",,,22001)
(1 row)
regards, tom lane