Qualify replacement function names instead of printing regprocedure

When generating CREATE OR REPLACE FUNCTION from an existing PostgreSQL function identifier, do not interpolate its regprocedure display string as the replacement name. PostgreSQL may omit the schema for a function visible on search_path, while creation targets the first creation schema. That can leave the original function untouched and create an unintended SECURITY DEFINER function with default grants elsewhere. Use an explicitly qualified schema and name. Verify both the expected body and the original function's identity, owner, ACL and settings afterward; comparing metadata while excluding the body cannot detect a missed replacement. Test with a migration search_path that differs from the target schema.

Applies when: a migration dynamically replaces an existing privileged PostgreSQL function. Keywords: PostgreSQL regprocedure migration schema search_path security definer grants identity