On Wed, 2025-05-28 at 03:01 +1200, Edwin UY wrote:
> Probably a dumb question of sorts.
> I want to check for function and procedure if they exist or not including those
> created by the users as well as system functions
>
> Will querying pg_catalog.pg_proc be enough? Using prokind to check if it is function
> or procedure and proowner whether it is a system function or user-defined?
That would simply be
SELECT pronamespace::regprocedure AS "schema",
oid::regprocedure
FROM pg_proc
WHERE proname = 'whatever';
Yours,
Laurenz Albe