To establish a connection to PostgreSQL in Linux/UNIX, do the following:
Step 1. Install the unixODBC driver manager:
Step 2. 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
Step 5. For compilation in LyciaStudio, go to Window → Preferences → 4GL → Database, and change the database type to unixODBC:
To connect to PostgreSQL on Windows, use the ODBC client.