Setting Up a PostgreSQL Connection

Connecting to PostgreSQL on Linux/UNIX

Connecting to PostgreSQL on Windows

Connecting to PostgreSQL on Linux/UNIX

To establish a connection to PostgreSQL in Linux/UNIX, do the following:

Step 1. Install the unixODBC driver manager:

sudo apt-get install unixodbc unixodbc-common unixodbc-dev odbcinst

Step 2. Install PostgreSQL ODBC driver:

Install postgresql odbc driver

Step 3. Configure /etc/odbc.ini (if the odbc.ini file has a custom location, make sure to provide a valid path):

[pgsql]

Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so

Database = database_name

Servername = 172.16.0.219

Username = user_name

Password = user password

Port = 5432

[pgsql] here is the name of database will be used in 4GL DATABASE statement.

Step 4. Configure the environment for compilation (console) and runtime (inet.env):

LYCIA_DB_DRIVER=odbc

ODBCINI=/etc/odbc.ini

Note: in LVSCE, the environment can be configured in .json files. For details, refer here: LVSCE Settings.

Step 5. For compilation in LyciaStudio, go to Window → Preferences → 4GL → Database, and change the database type to unixODBC:

Connecting to PostgreSQL on Windows

To connect to PostgreSQL on Windows, use the ODBC client.

 

Contact Us

Privacy Policy

Copyright © 2025 Querix, (UK) Ltd.