Describes how to connect to PostgreSQL.
The AnyDAC native driver supports PostgreSQL Server version 7.4 and higher, because it requires a PG protocol 3.0 connection.
AnyDAC requires the LIBPQ.DLL x86 or x64 client library for connecting to the PostgreSQL server. Ideally, the version should be equal to the server version. The full set of the v 9.0 client files:
You can take them from the server (
details) installation Bin folder and put into a folder:
[PG] VendorLib=<folder>\libpq.dll
When the PostgreSQL client library has not been properly installed, then you will get an exception when you try to connect:
[AnyDAC][Phys][PGSQL]-314. Cannot load vendor library [LIBPQ.DLL]. The specified module could not be found. Check [LIBPQ.DLL], which is located in one of the PATH directories or in application EXE directory.
or
The ordinal Nnn could not be located in the dynamic link library SSLEAY32.dll.
AnyDAC requires:
To install on Linux use the commands:
sudo apt-get updatesudo apt-get install libpq-dev
AnyDAC requires:
It comes preinstalled on Mac OS X or may be installed separately (
more).
To link the driver:
To connect to a PostgreSQL DBMS, most applications will need to specify DriverID, Server, Database, User_Name, Password, CharacterSet.
DriverID=PG
|
Parameter |
Description |
Example value |
|
Server |
The TCP/IP address or host name of the server running a PostgreSQL server. |
127.0.0.1 |
|
Port |
The TCP/IP port on which PostgreSQL server is listening. |
5432 |
|
Database |
Name of the current database for the connection. If the Database is not specified, no current database is set up. |
MyDB |
|
User_Name |
The PostgreSQL user ID. |
postgres |
|
Password |
The PostgreSQL user password. |
|
|
CharacterSet |
The default character set for the connection. See the Character Set Support chapter for details. |
WIN1251 |
|
LoginTimeout |
Controls the amount of time (in seconds) an application waits for a connection attempt to timeout while waiting to establish a connection. |
30 |
|
ExtendedMetadata |
Controls the extended describing of the query result sets:
|
False |
|
OidAsBlob |
Controls the interpretation of an OID column in a table:
|
Yes |
|
UnknownFormat |
Controls the handling of an unknown PostgreSQL data type:
|
BYTEA |
|
ApplicationName |
Name of the application. If specified, this value is stored in the pg_stat_activity table, application_name column. |
AllBooks |
|
PGAdvanced |
Additional PostgreSQL server connection options. See the Database Connection Control Functions chapter PQconnectdb paragraph for details. A value format is - <option>=<value>[;...]. |
|
|
MetaDefSchema |
Default schema name. Design time code will exclude the catalog name from the object name, if it is equal to MetaDefSchema. Setting MetaDefSchema does not change the current schema search path in PostgreSQL session. A 'public' is the default value. |
MySchema |
DriverID=PG Database=addemo
DriverID=PG Server=pgsrv Port=5433 Database=addemo CharacterSet=utf8 MetaDefSchema=MySchema ExtendedMetadata=True
|
What do you think about this topic? Send feedback!
|