Skip to content

📚 Pldebugger enabled

🔍 Prepare:

## OS and Software environment:

Environment name Version
OS Rocky Linux 9.x
DB PostgreSQL 16.X

### 1. Download Package

http_proxy="http://10.55.13.139:8080"
export http_proxy
https_proxy="http://10.55.13.139:8080"
export https_proxy

cat << EOF > /etc/yum.repos.d/pgdg_rocky-16.repo
[pgdg16]
name=PostgreSQL 16 for RHEL/CentOS
baseurl=https://download.postgresql.org/pub/repos/yum/16/redhat/rhel-\$releasever-\$basearch
enabled=1
gpgcheck=0
EOF

yum clean all
yum makecache
yum list |grep pldebugger
yum install -y pldebugger_16.x86_64

alt text

### 2. Modify permissions

chown -R postgres. /usr/pgsql-16/

### 3. Add plugin_debugger To The shared_preload_libraries In Your postgresql.conf File

vi /pgdata/Clustername/postgresql.conf
shared_preload_libraries = 'plugin_debugger'

alt text

pg_ctl restart -D /pgdata/Clustername/

### 4. Create pldbgapi extension

\dx
CREATE EXTENSION pldbgapi;
\dx

alt text

alt text

Must Create pldbgapi Extension on the database you want !!!

### 5. You can use the pgadmin4 to connect DB and you can see the pldbgapi extension is added and use it(By default, it is created under the public schema, production environments generally recycle public schema permissions)

alt text

GRANT USAGE ON SCHEMA public TO username;

alt text

### 6. if you want to use DBeaver to debug ,use should Install DBeaver Debug Extension

  • **6.1  Select submenu "Install new Software" from "Help" menu
  • **6.2 You can see "Install new software"
  • **6.3 Now press add button in "Install new software" dialog and add name (for example "Dbeaver Debug") and P2 URL from Jkiss.org (https://dbeaver.io/update/debug/latest/), press "OK" button when finished

alt text

alt text

alt text

  • **6.4 After platform finished downloading package from JKiss.org "Install" window will appear, click Next
  • **6.5 Carefully and completely read the license agreement, select the "I accept the terms of license agreement" if you agree with it and click Finish
  • **6.6 Now you need to accept installation by pressing "Install anyway" button 

alt text

alt text

alt text

  • **6.7 Now you need accept restarting DBeaver by pressing "Restart now" button
  • **6.8 And one more time pressing "OK"
  • **6.9 If you can see "Dbeaver Debug" in "Installed software tab" - debug plugin installed successfuly

alt text

alt text

alt text