The pgExpress Driver PostgreSQL dbExpress™ Driver installation procedure is similar to any other dbExpress™ driver's installation.
If you want to install the Delphi version, the files are under the pgExpress installation's Delphi directory; for the Kylix files, the directory is Kylix'.
If you're using the installer version (*.exe), it can perform the operations below for you, except configuring your connections parameters (what you can do manually or just double-clickcing a TSQLConnection component). You can edit the default [PGEConnection] entry it creates. The steps for manual installation are:
If you rename the library to libpq_pge.so, for instance, your entry should become VendorLib=libpq_pge.so accordingly. There are more instructions on the dbxdrivers.ini/dbxdrivers file below.
VendorLib=libpq.sounder Kylix or
VendorLib=libpq.dllunder Windows.
[Installed Drivers]
DB2=1
Interbase=1
MYSQL=1
Oracle=1
PostgreSQL=1
[Oracle]
GetDriverFunc=getSQLDriverORACLE
LibraryName=dbexpora.dll
VendorLib=OCI.DLL
BlobSize=-1
DataBase=Database Name
ErrorResourceFile=
LocaleCode=0000
Password=password
Oracle TransIsolation=ReadCommited
User_Name=user
[PostgreSQL]
GetDriverFunc=getSQLDriverPOSTGRESQL
LibraryName=dbexppge.dll
VendorLib=LIBPQ.DLL
On Kylix, the PostgreSQL section is slightly different to reflect the Linux library file names:
[PostgreSQL] GetDriverFunc=getSQLDriverPOSTGRESQL LibraryName=libdbexppge.so VendorLib=libpq.so
Still on Linux/Kylix , you must add your driver's path to the LD_LIBRARY_PATH environment variable (or copy the driver to your Kylix 's bin subdirectory):
LD_LIBRARY_PATH=/home/steve/lib/ export LD_LIBRARY_PATH
Edit the dbxconnections.ini file. On Kylix , it's is called dbxconnections. This file lists all the dbExpress™ connections and it can contain as many entries for the pgExpress Driver as you might want add. We supply here an example connection, but you should modify it to meet your own settings (specially the server address, database name, user name and password) params:
[PGEConnection] BlobSize=32 HostName=host Database=database_name DriverName=PostgreSQL Password=temp123 User_Name=steve
The only required parameters are Database, DriverName, UserName and Password if desired. You can use a more reduced form like the one below (you're encouraged to use it):
[PGEConnection] DriverName=PostgreSQL Database=hostname/database_name User_Name=steve Password=temp123
The other parameters are optional (and only those listed above are supported by the pgExpress Driver) and their meaning is that on dbExpress™ documentation. Pay special attention to the Database parameter. dbExpress™ only will load the HostName parameter if you set the TSQLConnection.LoadParamsOnConnect property to True. We at Vita Voom Software™ have used the following rules for the format of the Database parameter that avoid that confusion and also adds support for a Port parameter. It seems like an URL:
host:port/database
Where:
Database = myserver.mydomain.com/database Database = myserver.mydomain.com:5432/database Database = 111.111.111.111:5432/database Database = database
Note that if you supply both the HostName and Database parameters with embedded hostname (as show above), the Database parameter will prevail. Don't forget you can add as many sections to the dbxconnections file as you want, like this:
[PGEConnection] DriverName=PostgreSQL Database=hostname1/database_name User_Name=steve Password=temp123
[pgserver] DriverName=PostgreSQL Database=pgserver/database_name User_Name=john
That's it; the driver should be working now.