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_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/31235f5c08ae0e103a4713367c8ed52b2e6a26bd

Modified Files
--------------
src/backend/utils/adt/misc.c | 42 ++++++++++++++++++------------------------
1 file changed, 18 insertions(+), 24 deletions(-)

Reply via email to