How to get the function name of a regprocedure in PostgreSQL?
You have

ERROR:  syntax error at or near "variadic"


From the docs,


  VARIADIC parameters are input parameters, but are treated specially as described next.


That means you don't do anything special for VARIADIC parameters beyond what you would otherwise specify for input params. In your case, just drop that token,

SELECT get_funcname('my_func(text, text[])');



  Can anyone help explain how to fix the function or syntax?


Sure.

WHERE p.oid = regexp_replace(_fn, ' VARIADIC ', ' ', 'i');