Redash is an open source business intelligence (BI) tool that is used for data visualization. It also provides features such as alerting and subscription. You can use Redash to connect to AnalyticDB for PostgreSQL for data analysis. This topic describes how to use Redash to connect to AnalyticDB for PostgreSQL for visualized data analysis.
Prerequisites
An AnalyticDB for PostgreSQL instance is created as the data source.
Redash is installed. For more information, see the Redash documentation.
Procedure
Start Redash. In the upper-right corner of the page, click the
icon and select Data Sources from the drop-down list.
On the Data Sources tab of the Settings page, click +New Data Source to add a data source.
In the dialog box that appears, configure the parameters that are described in the following table.
Parameter
Description
Type Selection
PostgreSQL
The type of the data source. Search for and click PostgreSQL.
Configuration
Host
The internal endpoint of the AnalyticDB for PostgreSQL instance. You can log on to the AnalyticDB for PostgreSQL console and go to the Database Connection page of the instance to obtain the internal endpoint.
Port
The port number of the AnalyticDB for PostgreSQL instance. Default value: 5432.
User
The AccessKey ID of your Alibaba Cloud account. For more information, see Create an AccessKey pair.
Password
The AccessKey secret of your Alibaba Cloud account. For more information, see Create an AccessKey pair.
Database Name
The name of the database in the AnalyticDB for PostgreSQL instance.
After you configure the required parameters, click Create to establish a connection for querying data of the AnalyticDB for PostgreSQL instance.
In the top navigation bar, choose . On the New Query page, enter an SQL statement in the field in the right-side pane of the page.
After the SQL statement is executed, create a visual chart based on the query results.
For more information about how to write query statements and create visual charts in Redash, see the Redash documentation.