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_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1e6cdd4617d61e0d5327e4e70e8efeb784258c7f

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

Reply via email to