Quantcast
Channel: Tech Support
Viewing all articles
Browse latest Browse all 880

How To Install Debugger for PostgreSQL on Ubuntu 18/19/20.04

$
0
0

The debugger may be used to debug PL/pgSQL functions in PostgreSQL, as well as EDB-SPL functions, stored procedures and packages in EDB Postgres Advanced Server. The Debugger is available as an extension for your PostgreSQL installation. This guide assumes that you have already set up PostgreSQL on your Ubuntu.

 

Install Prerequisites

sudo apt install build-essential
sudo apt install postgresql-server-dev-12
sudo apt install openssl
sudo apt install krb5-multidev
sudo apt install libkrb5-dev
sudo apt install libssl-dev

 

Clone Debugger

cd /usr/local/src
sudo git clone https://git.postgresql.org/git/pldebugger.git

 

Install Debugger

cd pldebugger
export USE_PGXS=1
make
You will need to set appropriate permission on the following directories:
sudo chown -R your_username:your_username /usr/lib/postgresql
sudo chown -R your_username:your_username /usr/share/postgresql
sudo chown -R your_username:your_username /usr/share/doc/postgresql-doc-12
make install
Now revert the permission back to root:
sudo chown -R root:root /usr/lib/postgresql
sudo chown -R root:root /usr/share/postgresql
sudo chown -R root:root /usr/share/doc/postgresql-doc-12
Next, edit postgresql.conf file with any of your favorite text editor:
sudo nano /etc/postgresql/12/main/postgresql.conf
Find the following line, uncomment and add plugin_debugger like below:
shared_preload_libraries = 'plugin_debugger'
Save and close the file. Restart PostgreSQL to take changes into effect:
sudo pg_ctlcluster --mod fast 12 main restart
sudo systemctl restart postgresql
sudo systemctl status postgresql
Next, connect to a PostgreSQL database that you want to enable debugging install the extension:
psql -h localhost -U postgres

CREATE EXTENSION pldbgapi;

\q
You now have successfully installed debugger for your PostgreSQL database on Ubuntu 18/19/20.04.

Viewing all articles
Browse latest Browse all 880

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>