All Products
Search
Document Center

Dataphin:Create an AnalyticDB for PostgreSQL data source

Last Updated:Jul 07, 2025

By creating an AnalyticDB for PostgreSQL data source, you can enable Dataphin to read business data from or write data to AnalyticDB for PostgreSQL. This topic describes how to create an AnalyticDB for PostgreSQL data source.

Background information

AnalyticDB for PostgreSQL is Alibaba Cloud's cloud-native data warehouse that is compatible with ANSI SQL 2003 and PostgreSQL/Oracle database ecosystems. It uses Massively Parallel Processing (MPP) architecture to provide comprehensive transaction processing capabilities, high-throughput writes, and a unified batch and streaming processing engine. AnalyticDB for PostgreSQL implements high-performance data processing and real-time analysis through hybrid row-column storage and Alibaba Cloud's in-house developed compute engine. If you are using AnalyticDB for PostgreSQL and want to connect it to Dataphin for data development, you need to first create an AnalyticDB for PostgreSQL data source.

Permission requirements

Only custom global roles with the Create Data Source permission and system roles such as Super Administrator, Data Source Administrator, Domain Architect, and Project Administrator can create data sources.

Procedure

  1. In the top navigation bar of the Dataphin homepage, choose Management Center > Datasource Management.

  2. On the Datasource page, click +Create Data Source.

  3. On the Create Data Source page, select AnalyticDB For PostgreSQL in the Relational Database section.

    If you have recently used AnalyticDB for PostgreSQL, you can also select it in the Recently Used section. You can also enter keywords related to AnalyticDB for PostgreSQL in the search box to quickly find it.

  4. On the Create AnalyticDB For PostgreSQL Data Source page, configure the connection parameters.

    1. Configure the basic information of the data source.

      Parameter

      Description

      Datasource Name

      The name must meet the following requirements:

      • It can contain only Chinese characters, letters, digits, underscores (_), and hyphens (-).

      • The name can be up to 64 characters in length.

      Datasource Code

      After you configure the data source code, you can reference tables in the data source in Flink_SQL tasks by using the format data_source_code.table_name or data_source_code.schema.table_name. If you need to automatically access the data source in the corresponding environment based on the current environment, you can use the variable format ${data_source_code}.table or ${data_source_code}.schema.table. For more information, see Dataphin data source table development method.

      Important
      • The data source code cannot be modified after it is configured successfully.

      • After the data source code is configured successfully, you can preview data on the object details page in the asset directory and asset inventory.

      • In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, and SelectDB data sources are currently supported.

      Version

      You can select 6.x or 7.x. The default selection is 6.x.

      Data Source Description

      A brief description of the data source. It cannot exceed 128 characters.

      Time Zone

      The time zone will be used to process time format data in integration tasks. The default time zone is Asia/Shanghai. Click Modify to select a target time zone from the following options:

      • GMT: GMT-12:00, GMT-11:00, GMT-10:00, GMT-09:30, GMT-09:00, GMT-08:00, GMT-07:00, GMT-06:00, GMT-05:00, GMT-04:00, GMT-03:00, GMT-03:00, GMT-02:30, GMT-02:00, GMT-01:00, GMT+00:00, GMT+01:00, GMT+02:00, GMT+03:00, GMT+03:30, GMT+04:00, GMT+04:30, GMT+05:00, GMT+05:30, GMT+05:45, GMT+06:00, GMT+06:30, GMT+07:00, GMT+08:00, GMT+08:45, GMT+09:00, GMT+09:30, GMT+10:00, GMT+10:30, GMT+11:00, GMT+12:00, GMT+12:45, GMT+13:00, GMT+14:00.

      • Daylight Saving Time: Africa/Cairo, America/Chicago, America/Denver, America/Los_Angeles, America/New_York, America/Sao_Paulo, Asia/Bangkok, Asia/Dubai, Asia/Kolkata, Asia/Shanghai, Asia/Tokyo, Atlantic/Azores, Australia/Sydney, Europe/Berlin, Europe/London, Europe/Moscow, Europe/Paris, Pacific/Auckland, Pacific/Honolulu.

      Data Source Configuration

      Select the data source to configure:

      • If your business data source distinguishes between production and development data sources, select Production + Development Data Source.

      • If your business data source does not distinguish between production and development data sources, select Production Data Source.

      Tag

      You can categorize and tag data sources using tags. For information on how to create tags, see Manage data source tags.

    2. Configure the connection parameters between the data source and Dataphin.

      If you selected Production + Development Data Source for your data source configuration, you need to configure the connection information for both Production + Development Data Source. If you selected Production Data Source, you only need to configure the connection information for the Production Data Source.

      Note

      Typically, production and development data sources should be configured as separate data sources to achieve environment isolation between development and production, reducing the impact of development activities on production data sources. However, Dataphin also supports configuring them as the same data source with identical parameter values.

      For Configuration Method, you can choose either JDBC URL or Host. The default selection is JDBC URL.

      JDBC URL configuration method

      Parameter

      Description

      JDBC URL

      You can configure one or more IP addresses. Separate multiple IP addresses with commas (,).

      Schema

      Enter the schema associated with the username.

      Username, Password

      The username and password of the database.

      Host configuration method
      • Host configuration method

        Parameter

        Description

        Server Address

        Enter the IP address and port number of the server.

        You can click +Add to add multiple sets of IP addresses and port numbers, and click the image icon to delete extra IP addresses and port numbers. You must keep at least one set.

        dbname

        Enter the database name.

      • Parameter configuration

        Parameter

        Description

        Parameter

        • Parameter name: You can select an existing parameter name or enter a custom parameter name.

          Custom parameter names can only contain letters, digits, periods (.), underscores (_), and hyphens (-).

        • Parameter value: When a parameter name is selected, the parameter value is required. It can only contain letters, digits, periods (.), underscores (_), and hyphens (-), and cannot exceed 256 characters.

        Note

        You can click +Add Parameter to add multiple parameters, and click the image icon to delete extra parameters. You can add up to 30 parameters.

        Schema (optional)

        Enter the specific schema information to read. Cross-schema table selection is supported. Please select the schema where the table is located. If not specified, the default is the schema configured in the data source.

        Username, Password

        Enter the username and password of the database.

      Note

      After creating a data source with the Host configuration method, if you need to switch to the JDBC URL configuration method, the system will concatenate the server's IP address and port number into a JDBC URL format.

    3. Configure advanced settings for the data source.

      Parameter

      Description

      connectTimeout

      The connectTimeout duration of the database (in seconds). The default is 900 seconds (15 minutes).

      Note
      • If you have a connectTimeout configuration in your JDBC URL, the connectTimeout will be the timeout value configured in the JDBC URL.

      • For data sources created before Dataphin V3.11, the default connectTimeout is -1, which means no timeout limit.

      socketTimeout

      The socketTimeout duration of the database (in seconds). The default is 1800 seconds (30 minutes).

      Note
      • If you have a socketTimeout configuration in your JDBC URL, the socketTimeout will be the timeout value configured in the JDBC URL.

      • For data sources created before Dataphin V3.11, the default socketTimeout is -1, which means no timeout limit.

      Connection Retry Count

      If the database connection times out, the system will automatically retry the connection until the specified retry count is reached. If the maximum retry count is reached and the connection is still unsuccessful, the connection fails.

      Note
      • The default retry count is 1. You can configure a value between 0 and 10.

      • The connection retry count will be applied by default to Offline Integration Tasks and Global Quality (requires the Asset Quality function module to be enabled). In offline integration tasks, you can configure task-level retry counts separately.

    Note

    Rules for duplicate parameter values:

    • If a parameter exists in JDBC URL, Advanced Settings, and Host Configuration parameter settings simultaneously, the value in the JDBC URL takes precedence.

    • If a parameter exists in both JDBC URL and Advanced Settings, the value in the JDBC URL takes precedence.

    • If a parameter exists in both Advanced Settings and Host Configuration parameter settings, the value in Advanced Settings takes precedence.

  5. Select a Default Resource Group. This resource group is used to run tasks related to the current data source, including database SQL, offline database migration, data preview, and more.

  6. Click Test Connection or directly click OK to save and complete the creation of the AnalyticDB for PostgreSQL data source.

    When you click Test Connection, the system tests whether the data source can connect normally to Dataphin. If you directly click OK, the system automatically tests the connection for all selected clusters. However, even if all selected clusters fail the connection test, the data source can still be created normally.