PostgreSQL psqlodbc driver in 64-bit Systems
Http://www.postgresql.org/ftp/odbc/versions/src/
Install the installation package required by psqlodbc in a 2-64-bit system:
UnixODBC-2.3.1.tar.gz
Psqlodbc-09.01.0100.tar.gz
3. Install unixodbc
Tar zxvf unixODBC-2.3.1.tar.gz
CD unixODBC-2.3.1
./Configure -- enable-Gui = No
Make
Make install
4. Install psqlodbc
Unixodbc supports ODBC in Linux, but it is only an ODBC manager. to connect to the actual database, you also need to provide the ODBC driver for this database.
Psqlodbc is a free ODBC driver used to connect to PostgreSQL in Linux.
Note: you must first install unixodbc and then install psqlodbc.
Tar zxvf psqlodbc-09.01.0100.tar.gz
CD psqlodbc-09.01.0100
./Configure -- With-unixodbc -- With-libpq =/usr/local/pgsql
Make
Make install
5. Configure ODBC (one sample is provided below)
VI/etc/odbcinst. ini
[Postgressql]
Description = ODBC for PostgreSQL
Driver =
Driver64 =/usr/local/lib/psqlodbcw. So
Setup =
Setup64 =
Fileusage = 1
Cptimeout =
Cpreuse =
CP/etc/odbcinst. INI/usr/local/etc/odbcinst. ini
VI/etc/ODBC. ini
[Tmau_psv3]
Description = tmau_psv3
Driver = postgressql
Trace = No
Tracefile =
Database = tmau_psv3
Servername = 192.168.51.97
Username = pgadmin
Password = kgpgadmin
Port = 5432
Protocol= 6.4
Readonly = No
Rowversioning = No
Showsystemtables = No
Showoidcolumn = No
Fakeoidindex = No
Connsettings =
CP/etc/ODBC. INI/usr/local/etc/ODBC. ini
6. Use the iSQL tool provided by ODBC to check whether the ODBC driver and DNS are configured successfully.
[Root @ r710-64c6 64bits_install] # iSQL-V tmau_psv3
+ --------------------------------------- +
| Connected! |
|
| SQL-statement |
| Help [tablename] |
| Quit |
|
+ --------------------------------------- +
SQL>
As shown in the preceding figure, psqlodbc is successfully configured.