Configure Connection
PostgreSQL guide
Install the ODBC driver, prepare database permissions, and configure and test PostgreSQL access in NIM.
Before you startDirect link to Before you start
This integration requires the PostgreSQL ODBC driver (psqlODBC) on the NIM server.
NIM requires Hostname, Port, Driver name, Database, Username, and Password. A default Driver name is provided in the connector.
Prepare the ODBC driver and network accessDirect link to Prepare the ODBC driver and network access
- Install psqlODBC for the architecture used by the NIM connector.
- Confirm the registered driver name in Windows ODBC Data Source Administrator > Drivers.
- Have your database administrator confirm that PostgreSQL accepts connections from the NIM server. Check the server's listening configuration, network access, and host-based authentication rules.
Create a login roleDirect link to Create a login role
On a Linux PostgreSQL host where local administrative access is configured, start psql as the postgres OS user:
sudo -u postgres psql
For Windows, a managed service, or another deployment, use your normal administrative connection instead. Connect with a superuser or a role authorized to create roles and grant the needed privileges.
Create the integration user, replacing the username and password placeholder:
CREATE USER nim_user WITH PASSWORD 'REPLACE_WITH_A_SECURE_PASSWORD';
PostgreSQL's CREATE USER reference explains that this creates a role with login enabled.
Grant database, schema, and table accessDirect link to Grant database, schema, and table access
Replace nimdata with the target database name:
GRANT CONNECT ON DATABASE nimdata TO nim_user;
Switch to the target database before granting schema or table privileges:
\connect nimdata
For source collection from existing objects in public:
GRANT USAGE ON SCHEMA public TO nim_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO nim_user;
For full CRUD on records, grant the required table privileges instead:
GRANT SELECT, INSERT, UPDATE, DELETE
ON ALL TABLES IN SCHEMA public TO nim_user;
If inserts use sequence-generated values, grant access to the required sequences, for example:
GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO nim_user;
Replace public with your source schema where needed. ALL TABLES covers existing objects; arrange appropriate grants for future objects separately.
Database-level ALL PRIVILEGES does not grant table access. Schema CREATE permission is needed only when the process creates objects in that schema:
GRANT CREATE ON SCHEMA public TO nim_user;
See the PostgreSQL GRANT reference for privilege scope and syntax.
Enter the connection settingsDirect link to Enter the connection settings
- In NIM Studio, open Systems > Overview and add a PostgreSQL system, or select the existing system.
- Open its Connection screen.
- Enter the following settings and save the connection.
| NIM setting | Value |
|---|---|
| Hostname | The PostgreSQL server hostname. |
| Port | The database connection port supplied by your administrator. |
| Driver name | The registered PostgreSQL ODBC driver name. Retain the connector default if it matches the installed driver. |
| Database | The target database name. |
| Username | The PostgreSQL login role prepared for NIM, such as nim_user. |
| Password | The password assigned to that role. |
Test the database connectionDirect link to Test the database connection
- Select Test Connection. NIM attempts to open a connection to the configured PostgreSQL database.
- Confirm that the connection opens successfully. If it fails, check the ODBC driver, hostname, port, database, credentials, network access, and host-based authentication rules.
- Collect the system and inspect the expected tables or query results.
- If connection succeeds but collection fails, verify schema usage and table permissions for the configured query.
- Validate the collected records and matching rules before using PostgreSQL as source or supplemental data for automation.
A successful connection test does not confirm access to every object or operation. Validate collection and any intended writes separately.