If you are going to connect to a localhost PostgreSQL database you do not need to setup any additional libraries to use SQLines Data tool as they are already supplied with PostgreSQL server.
If you need to connect to a remote PostgreSQL database, you need to have PostgreSQL C API libpq (PostgreSQL native client software) installed in your system.
If you use pgAdmin 4 tool the PostgreSQL client software is also already installed.
First check if you already have PostgreSQL libpq.so.5 library, for example:
Note that many Linux distributions are supplied with PostgreSQL library by default. Try to find its location by running:
find / -name "libpq.so.5"
If you do not have PostgreSQL libraries installed, go to https://www.postgresql.org/download and install appropriate version or install pgAdmin 4 tool at https://www.pgadmin.org/download/
To enable SSL connection to PostgreSQL database server (i.e. Google Cloud SQL for PostgreSQL), set the following environment variables before running ./sqldata:
export PGSSLMODE=require export PGSSLROOTCERT=server-ca.pem export PGSSLCERT=client-cert.pem export PGSSLKEY=client-key.pem
When you click Test Connection you get the following error:
Possible reasons:
To set the PATH variable on Windows, right-click the Computer icon, select Properties, click the Advanced System Settings. Then select Advanced tab and click the Environment Variables button. Go to System Variables, find and append Path.
Note. You have to restart SQLines Data tool after modifying the PATH environment variable.
You can also edit sqldata.cfg configuration file and set -pg_lib option.
Contact us at support@sqlines.com if you still have any connection problems.