PostgreSQL Tutorial: Debug PL/pgSQL functions with pgAdmin 4
Summary: The pgAdmin debugger may be used to debug PL/pgSQL functions, as well as stored procedures in PostgreSQL. The Debugger is available as an extension for your PostgreSQL installation. You must have superuser privileges to use the debugger.