- 1- Linux Installation
- 2- Windows Installation
- 3- FreeBSD Installation
- 4- MacOSX Installation
- 5- Post-installation steps ** REQUIRED **
You can install from Debian PGDG repository or from standalone packages or compile from source.
- 1.1. Installing from Debian PGDG repository (recommended)
- 1.2. Installing from DEB/RPM packages
- 1.3. Compiling the extension from source
On Debian and Ubuntu systems, this is the recommended way of installing the OmniDB debugger for PostgreSQL PL/pgSQL functions and procedures.
sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
sudo wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
sudo apt install postgresql-X.Y-omnidb
nano /etc/postgresql/X.Y/main/postgresql.conf
shared_preload_libraries = 'omnidb_plugin'
sudo systemctl restart postgresql
psql -d <database> -c 'CREATE EXTENSION omnidb_plugin'
psql -d <database> -f sample_functions.sql
Follow Post-installation steps in section 5.
# For example, Debian-like 64 bits:
sudo dpkg -i omnidb-plugin_2.17.0-debian-amd64.deb
# For example, for CentOS-like 64 bits:
sudo rpm -ivU omnidb-plugin_2.17.0-centos-amd64.rpm
# Find the PostgreSQL version and path for $libdir and create a link to the specific library. For example:
sudo ln -s /opt/omnidb-plugin/omnidb_plugin_96.so /usr/lib/postgresql/9.6/lib/omnidb_plugin.so
nano /etc/postgresql/X.Y/main/postgresql.conf
shared_preload_libraries = 'omnidb_plugin'
sudo systemctl restart postgresql
psql -d <database> -f debugger_schema.sql
psql -d <database> -f sample_functions.sql
Follow Post-installation steps in section 5.
sudo apt install postgresql-server-dev-X.Y libpq-dev
make
sudo make install
nano /etc/postgresql/X.Y/main/postgresql.conf
shared_preload_libraries = 'omnidb_plugin'
sudo systemctl restart postgresql
psql -d <database> -c 'CREATE EXTENSION omnidb_plugin'
psql -d <database> -f sample_functions.sql
Follow Post-installation steps in section 5.
Download the zip corresponding to your architecture from the website.
Move the omnidb_plugin.dll corresponding to your PostgreSQL version to the folder lib, which is inside the folder where PostgreSQL was installed.
Change the file PostgreSQL_directory/data/postgresql.conf, including the following line:
shared_preload_libraries = 'omnidb_plugin'
Then restart PostgreSQL.
psql -d <database> -f debugger_schema.sql
psql -d <database> -f sample_functions.sql
Follow Post-installation steps in section 5.
Download the tar.gz corresponding to your architecture from the website.
wget --no-check-certificate https://omnidb.org/dist/2.17.0/omnidb-plugin_2.17.0-freebsd.tar.gz
Move the omnidb_plugin.so corresponding to your PostgreSQL version to the folder lib, which is inside the folder where PostgreSQL was installed.
tar -xzvf omnidb-plugin_2.17.0-freebsd.tar.gz
cp omnidb-plugin_2.17.0-freebsd/omnidb_plugin_10.so /usr/local/lib/postgresql/omnidb_plugin.so
Change the file PostgreSQL_directory/data/postgresql.conf, including the following line:
shared_preload_libraries = 'omnidb_plugin'
Then restart PostgreSQL.
psql -d <database> -f debugger_schema.sql
psql -d <database> -f sample_functions.sql
Follow Post-installation steps in section 5.
If you have PostgreSQL installed in your Mac and want to also install OmniDB debugger, please be aware that currently we don't offer any packages for the debugger for Mac OS X. Your only option is to compile and install from sources. It is not that hard, as you can see below.
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
This will also install PostgreSQL headers and libpq.
If brew is not installed yet, you can install it like this:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then:
brew install postgresql
make
sudo make install
vim /usr/local/var/postgres/postgresql.conf
shared_preload_libraries = 'omnidb_plugin'
brew services restart postgresql
psql -d <database> -c 'CREATE EXTENSION omnidb_plugin'
psql -d <database> -f sample_functions.sql
Follow Post-installation steps in section 5.
5.1. Grant privileges to each database user that will debug functions (should be done by a superuser)
Every database user that uses the debugger needs access to the debugger control tables.
psql -d <database> -c 'GRANT ALL ON SCHEMA omnidb TO <user>; GRANT ALL ON ALL TABLES IN SCHEMA omnidb TO <user>;'
Every database user that uses the debugger needs local passwordless access to the target database. This is because the database will create an additional local connection to perform debugging operations.
We need to add a rule to pg_hba.conf of type host
, matching the PostgreSQL
user and database OmniDB is connected to. The method can be either trust
,
which is insecure and not recommended, or md5
.
- Add a rule similar to:
# TYPE DATABASE USER ADDRESS METHOD
host <database> <user> 127.0.0.1/32 trust
host <database> <user> ::1/128 trust
- Add rules similar to:
# TYPE DATABASE USER ADDRESS METHOD
host <database> <user> 127.0.0.1/32 md5
host <database> <user> ::1/128 md5
- Create a
.pgpass
file with a similar content:
localhost:<port>:<database>:<username>:<password>
More information about how .pgpass
works can be found here: https://www.postgresql.org/docs/11/static/libpq-pgpass.html