Don't try to cache the result of parseTypeString in pg_input_is_valid. pg_input_is_valid_common() thought it could avoid repeatedly parsing its type-name argument. However, it didn't really know whether the argument is constant (get_fn_expr_arg_stable isn't adequate here); and even if it did know, the answer could still change from time to time as a result of changes in search_path etc. So give up on that idea and just parse the string every time. We do retain the logic to avoid repeated lookups of the input function as long as we get the same type OID each time; that corresponds to the same caching logic used in many other places.
Oversight in commit 1939d2628. Author: Xnerv Wang <[email protected]> Reviewed-by: Chao Li <[email protected]> Reviewed-by: Andreas Karlsson <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/CAFEh72DTdqrHwe01V+Y2xdL=fj3ljwvyp6yyztccuwwddp1...@mail.gmail.com Backpatch-through: 16 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/734853ec785d86cd26b753cc3fb425e23dc31fde Modified Files -------------- src/backend/utils/adt/misc.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-)
