The CData ODBC driver for PostgreSQL enables access to live data from PostgreSQL under the ODBC standard, allowing you work with PostgreSQL data in a wide variety of BI, reporting, and ETL tools and directly, using familiar SQL queries. This article shows how to connect to PostgreSQL data as a generic ODBC Data Provider and create charts, reports, and dashboards based on PostgreSQL data in DBxtra.
Connect to PostgreSQL Data
- If you have not already done so, provide values for the required connection properties in the data source name (DSN). You can configure the DSN using the built-in Microsoft ODBC Data Source Administrator. This is also the last step of the driver installation. See the "Getting Started" chapter in the Help documentation for a guide to using the Microsoft ODBC Data Source Administrator to create and configure a DSN.
To connect to PostgreSQL, set the Server, Port (the default port is 5432), and Database connection properties and set the User and Password you wish to use to authenticate to the server. If the Database property is not specified, the data provider connects to the user's default database.
SSH Connectivity for PostgreSQL
You can use SSH (Secure Shell) to authenticate with PostgreSQL, whether the instance is hosted on-premises or in supported cloud environments. SSH authentication ensures that access is encrypted (as compared to direct network connections).
SSH Connections to PostgreSQL in Password Auth Mode
To connect to PostgreSQL via SSH in Password Auth mode, set the following connection properties:
- User: PostgreSQL User name
- Password: PostgreSQL Password
- Database: PostgreSQL database name
- Server: PostgreSQL Server name
- Port: PostgreSQL port number like 3306
- UserSSH: "true"
- SSHAuthMode: "Password"
- SSHPort: SSH Port number
- SSHServer: SSH Server name
- SSHUser: SSH User name
- SSHPassword: SSH Password
SSH Connections to PostgreSQL in Public Key Auth Mode
To connect to PostgreSQL via SSH in Password Auth mode, set the following connection properties:
- User: PostgreSQL User name
- Password: PostgreSQL Password
- Database: PostgreSQL database name
- Server: PostgreSQL Server name
- Port: PostgreSQL port number like 3306
- UserSSH: "true"
- SSHAuthMode: "Public_Key"
- SSHPort: SSH Port number
- SSHServer: SSH Server name
- SSHUser: SSH User name
- SSHClientCret: the path for the public key certificate file
When you configure the DSN, you may also want to set the Max Rows connection property. This will limit the number of rows returned, which is especially helpful for improving performance when designing reports and visualizations.
- Open the DBxtra application and in the New menu click Project and name the Project.
π Creating a New Project.
- Select ODBC Connection as the Data Connection Type.
π Creating an ODBC Connection.
- Click the browse option () for the Data Source.
- In the Data Link Properties window, select Microsoft OLE DB Provider for ODBC Drivers on the Provider tab.
π Select the Provider
- On the Connection tab, select the Data Source Name and the initial catalog to use (CData).
π Select the Provider
- Name the Connection and select the appropriate User Groups.
π Connection name and User Groups
- Double-click the Connection from within the Project to connect to the data.
π Connecting to the data.
Create a Dashboard with PostgreSQL Data
You are now ready to create a dashboard with PostgreSQL data.
- Right-click Report Objects under the Project and select New Report Object.
π Creating a Report Object for the Project
- In the new Report Object, click the link to create the Query.
- In the Select Data Connection window, select the newly created data connection.
π Select Data Connection
- On the Query tab, expand the connection objects and select the Tables, Views, and specific columns you wish to include in your dashboard. You can specify search requirements and even create complex queries which include JOINs and aggregations.
π Selecting the data/building the query.
- On the Dashboard tab, select the visualizations and features for your dashboard. Assign the data values from the query to the appropriate fields for the Dashboards items (Values, Series, etc.)
π Building the Dashboard.
With a new Dashboard created, you are ready to begin analysis of PostgreSQL data. Thanks to the ODBC Driver for PostgreSQL, you can refresh the Dashboard and immediately see any changes made at the source. In the same way, you can create and view Reports with live, up-to-date PostgreSQL data.