PostgreSQL for Hydra
For Windows environment, the Full version (about 4.0 MB) is recommended and for Unix/Linux platforms the Source version (about 0.5 MB) is needed.
For a Unix/Linux connection, there are three main stages needed. These are:
- Install the iODBC driver manager
- Install the PostgreSQL ODBC driver
- Set up the DSN
The iODBC driver manager for Unix/Linux platforms can be downloaded from http://www.iodbc.org by following the “downloads, cvs” link.
The PostgreSQL ODBC driver can be downloaded from http://www.postgresql.org/.
The link to the downloads page can also be found in the Top 5 Projects list under the GBorg heading down the left-hand side of the PostgreSQL main page.
PostgreSQL Windows Connection
The PostgreSQL driver can be downloaded as a .zip file. Extract the file
psqlodbc.exe to the C:\Program Files\ directory.
In this example, the name of the downloaded zip file was psqlodbc.
Windows already includes an ODBC driver manager, so this does not need to be installed separately.
Installing the Driver
- From the Windows Start menu, select the Run option and browse to find the psqlodbc.exe file. When you have found it, run the .exe file.
- In the first window of the installation wizard, click the Next button.
- Read the License Agreement, and if you agree to its terms, select the “I accept the license agreement” radio button, and click the Next key.
- In the psqlODBC Setup window, click the Next button. The installation process will begin. This should take about ten seconds to complete.
- When the installation is complete, click the Finish button.
PostgreSQL Unix/Linux Connection
An ISO C compliant compiler (or ANSI C) must be installed before installation of PostgreSQL.
Installing the iODBC Driver Manager
The iODBC Driver Manager can be downloaded as an rpm file, or for older platform versions, a tar.gz file. You will need to build the driver manager. Download the appropriate file and copy it to your /usr directory. If you have a tar.gz file follow steps 1 to 3 and then continue at step 5, for an rpm file start at step 4.
- With the downloaded file in the /usr directory, unzip the file with the command: gunzip libiodbc-3.51.1.tar.gz
- Extract the files with the command: tar xvf libiodbc-3.51.1..tar
- Change directory to the newly created installation directory with the command: cd iodbc-3.51.1.
- For an rpm file, run the command: rpm –i file_name
- In the new directory run the command: ./configure The system will carry out a series of configuration functions.
- Run the command: make
- Run the command: make install
Installing the PostgreSQL ODBC Driver
The PostgreSQL ODBC driver can be downloaded as a tar.gz file. You will need to build the driver manager. Download the appropriate file and copy it to your /usr directory.
- With the downloaded file in the /usr directory, unzip the file with the command: gunzip psqlodbc-07.03.0200.tar.gz
- Extract the files with the command: tar xvf psqlodbc-07.03.0200.tar
- Change directory to the newly created installation directory with the command: cd psqlodbc-07.03.0200
- In the new directory run the command: ./configure The system will carry out a series of configuration functions.
- Run the command: make
- Run the command: make install
Creating a DSN
The database and the DSN must have the same name, otherwise serious system error may be encountered.
You will also need to find the location of the psqlodbc.so file before starting to create the DSN. This will probably be /usr/lib/psqlodbc.so.
- Search for the file /etc/odbc.ini.
This may have been created during the iODBC installation. If it has not, you will need to create the file manually. If you have to create the /etc/odbc.ini file manually it should look something like the example shown in Step 2. Add the following details to the odbc.inin file:
[ODBC Data Sources] cms = PostgreSQL cms [cms] Description = PostgreSQL cms Driver = /usr/lib/psqlodbc.so Trace = No TraceFile = /tmp/odbc.log Databse = cms UserName = Password = Port = 5432 Protocol = 6.4 ReadOnly = Yes RowVersioning = No ShowSystemTables = No SowOidColumn = No FakeOidIndex = No ConnSettings =
Edit the following settings in your environment:
HYDRA_DB_DRIVER=odbc SQLSERVER=cms ODBCINI=/etc/odbc.ini
Each user can have their own odbc.ini file if needed. If you want to test the connection to the database, you can use the ‘odbctest’ tool, provided by iODBC, as well as the ‘testconn’ application in ‘HydraStudio’.
Related articles