Connecting to a PostgreSQL database from Altair SLC on Linux


If you have data stored in a PostgreSQL database, you can connect by installing the PostgreSQL command line tools. The PostgreSQL client programs are available as an RPM package, or as a Debian Software Package. To install the PostgreSQL client programs:

  1. Ensure you are able to invoke the sudo command. Install the client programs using the following command:
    • For systems that use RPM packages
       sudo yum install postgresql
    • For systems that use Debian software packages
       sudo apt-get install postgresql-client
  2. Enter Y when prompted to confirm installation.
  3. Once the client tools have been installed, test the database connectivity with the following SAS language program:
    LIBNAME DATASRC POSTGRESQL USER=user-name PASSWORD=password 
            SERVER=remote-id DATABASE=dbase;
    PROC DATASETS LIBRARY=DATASRC;
    RUN;
    • In the LIBNAME statement, replace user-name and password with your user name and password for the remote-id server, and replace dbase with the name of the PostgreSQL database.
    • The DATASETS procedure returns the names of all tables in the selected database; for databases with large numbers of tables, this program might take some time to run.