- 1- Linux Installation
- 2- Windows Installation
- 3- FreeBSD Installation
- 4- Post-installation steps ** REQUIRED **
You can install from packages or compile from source.
- 1.1. Installing from DEB/RPM packages
- 1.2. Compiling the extension from source
# For example, Debian-like 64 bits:
sudo dpkg -i omnidb-plugin_2.13.0-debian-amd64.deb
# For example, for CentOS-like 64 bits:
sudo rpm -ivU omnidb-plugin_2.13.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 4.
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 4.
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 4.
Download the tar.gz corresponding to your architecture from the website.
wget --no-check-certificate https://omnidb.org/dist/2.13.0/omnidb-plugin_2.13.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.13.0-freebsd.tar.gz
cp omnidb-plugin_2.13.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 4.
4.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 database. This is because the database will create an additional local connection to perform debugging operations.
This can be done by adding a rule to pg_hba.conf or changing .pgpass of the postgres user.
Add a rule similar to:
a) Linux:
# TYPE DATABASE USER ADDRESS METHOD
local all <user> trust
b) Windows:
# TYPE DATABASE USER ADDRESS METHOD
host all <user> 127.0.0.1/32 trust
hostname:port:database:username:password
More information about how .pgpass
works can be found here: https://www.postgresql.org/docs/10/static/libpq-pgpass.html