This topic describes how to debug the stored procedures of an ApsaraDB RDS for PostgreSQL instance by using the pldebugger plug-in.
Background information
ApsaraDB RDS for PostgreSQL supports various stored procedure languages, such as PL/pgSQL, PL/Python, PL/Perl, and PL/Tcl. You can use these languages to create functions or stored procedures.
Prerequisites
- Your RDS instance runs one of the following database engine versions:
- Major engine version: PostgreSQL 10, PostgreSQL 11, PostgreSQL 12, or PostgreSQL 13.
- Minor engine version: 20211130 or later. For more information about how to update the minor engine version, see Update the minor engine version of an ApsaraDB RDS for PostgreSQL instance.
- plugin_debugger is added to the value of the shared_preload_libraries parameter of your RDS instance.
For more information about how to add plugin_debugger to the value of the shared_preload_libraries parameter, see Manage the parameters of an ApsaraDB RDS for PostgreSQL instance.
- The version of pgAdmin4 on your database client is 4.19 or later. You can download pgAdmin4 at pgAdmin4.
Procedure
- Enable the pldebugger plug-in.
CREATE EXTENSION pldbgapi;
Note Only privileged accounts are authorized to execute the preceding statement. - Disable the pldebugger plug-in.
DROP EXTENSION pldbgapi;
Note Only privileged accounts are authorized to execute the preceding statement.