How do I connect to Vertica from Linux?

Nico Chart_21517
Nico Chart_21517
Altair Employee

PLEASE NOTE Our Vertica engine is deprecated in 2024 and removed from the software in future versions.

Vertica is accessed via an ODBC interface and so the unixODBC generic driver must also be installed and configured.

The typical steps needed to connect to a Vertica database from Unix in 64-bit mode would be:
1. Make sure you select the correct connector to match your 64-bit Altair SLC installation as we no longer support 32-bit.
2. Unpack the kit into some area e.g. $HOME/odbc/vertica for this example
3. Update the LD_LIBRARY_PATH to point to the directory containing the unixODBC 2.3.2 object library
EXPORT LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/gm/odbc/unixodbc/unixODBC-2.3.2/lib
5. Add an entry to your odbc.ini of the form:

[ODBC Data Sources]
VTSQL = Vertica

[VTSQL]
Description = Vertica Database
Driver = /home/gm/odbc/vertica/lib64/libverticaodbc.so
Database = <YOUR_DATABASE_NAME>
Servername = vertica
Username = <YOUR_USERNAME>
Password = <YOUR_PASSWORD>
Port = 5433
ConnSettings = SET SESSION AUTOCOMMIT TO OFF
;SSLKeyFile = /home/dbadmin/client.key
;SSLCertFile = /home/dbadmin/client.crt
Locale = en-GB

6. Create or customize your odbcinst.ini file based on a sample from the vertica client

[VerticaSQL]
Description = Vertica ODBC driver
Driver = /home/gm/odbc/vertica/lib64/libverticaodbc.so
Setup = /home/gm/odbc/vertica/lib64/libverticaodbc.so

7. Make sure you have environmental variables VERTICAINI setup to point to the directory containing vertica.ini and odbcinst.ini files and ODBCINI = path_to_odbc.ini and ODBCINST= path_to_odbcinst.ini
NOTE: You will need to replace <YOUR..> parts with your own specific details and /home/gm with the path to where your netezza client lives.

You should then be able to use a libname statement of the form:

Libname nz vertica user=<your_username> password=<your_password> DSN=VTSQL;

Tagged: