Hello, I've stumbled across what seems to be a bug.
I wanted to use a function that safely cast something to something else.
Here's a simple minimal reproduction:
CREATE OR REPLACE FUNCTION safe_cast(text, anyelement) RETURNS anyelement AS $$
BEGIN
$0 := $1;
RETURN $0;
EXCEPTION WHEN OTHERS THEN
RETURN $2;
END;
$$ LANGUAGE plpgsql;
SELECT safe_cast('abc'::text, 42::numeric);
Here's a debug: 5 log in my app (in a bit more complex usecase):
And the error in the playground: Dynamic linking error: cannot resolve symbol setTempRet0
You can test it here: https://pglite.dev/repl/
Here, it works as intented: https://onecompiler.com/postgresql/