Help Center/ Huawei Cloud Flexus_Huawei Cloud Flexus RDS/ Getting Started/ Buying and Connecting to a FlexusRDS for PostgreSQL Instance
Updated on 2025-06-30 GMT+08:00

Buying and Connecting to a FlexusRDS for PostgreSQL Instance

This section describes how to purchase a FlexusRDS for PostgreSQL instance and how to connect to it using Data Admin Service (DAS).

Preparations

  1. Sign up for a Huawei ID and enable Huawei Cloud services.
  2. Before purchasing DB instances, ensure that your account balance is sufficient. Top up your account if required.
  3. For fine-grained permissions management, create an Identity and Access Management (IAM) user and user group on the IAM console and grant the user specific operation permissions. For details, see Creating a User and Granting Permissions.

Step 1: Create a FlexusRDS for PostgreSQL Instance

  1. Go to the FlexusRDS console.
  2. If this is your first time to create a DB instance, click Buy.
  3. Configure the instance information and click Buy.
    Figure 1 Selecting an instance class
    Figure 2 Selecting the required duration

    Parameter

    Example Value

    Description

    Region

    CN-Hong Kong

    Region where your resources are located.

    NOTE:

    Products in different regions cannot communicate with each other through a private network. After a DB instance is created, the region cannot be changed. Therefore, exercise caution when selecting a region.

    DB Engine

    PostgreSQL 16

    The DB engine version.

    Instance Class

    Standard 2U4G

    The vCPU and memory of an instance.

    DB Instance Type

    Single

    The architecture type of an instance.

    • Single: A single-node architecture. It is less expensive than a primary/standby DB pair.
    • Primary/Standby: An HA architecture. In a primary/standby pair, each instance has the same instance class. When a primary instance is being created, a standby instance is provisioned along with it to provide data redundancy. The standby instance is invisible to you after being created.

    Storage

    120 GB

    The storage space of an instance.

    Network

    vpc-default-smb

    subnet-default-smb

    A Virtual Private Cloud (VPC) is a virtual network in which your instance is located. A VPC can isolate networks for different workloads.

    A subnet provides dedicated network resources that are logically isolated from other networks for security purposes.

    For details about how to create a VPC and subnet, see Creating a VPC and Subnet.

    DB Instance Name

    flexusrds-1234

    The instance name must start with a letter and consist of 4 to 64 characters. Only letters (case-sensitive), digits, hyphens (-), underscores (_), and periods (.) are allowed.

    If you buy multiple DB instances at a time, their names will include a four-digit suffix. For example, if you specify instance here, the names will be instance-0001, instance-0002, and so on. If existing instances' suffixes have already reached up to 0010, the new instance names will start from instance-0011.

    Required Duration

    1 year

    The system will automatically calculate the configuration fee based on the selected required duration. The longer the required duration is, the larger discount you will enjoy.

    Auto-renew

    Disabled

    • This option is not selected by default.
    • If you select this option, the auto-renew cycle is determined by the selected required duration.

    Quantity

    1

    The number of instances to be purchased in a batch.

  4. Confirm the order and click Pay Now.
    Figure 3 Order confirmation
  5. Select a payment method and complete the payment.
  6. View the purchased instance.
    • Administrator account: root
    • Password of the administrator account: The password is randomly set by the system. You need to reset the password when using the account.
    Figure 4 Instance successfully purchased

Step 2: Connect to the FlexusRDS for PostgreSQL Instance

  1. In the instance list, locate the instance and click Reset Password in the Operation column.
    Figure 5 Instance list
  2. Enter a new password, confirm the password, and click OK.
    Figure 6 Resetting a password
  3. In the instance list, locate the instance and click Log In in the Operation column.
    Figure 7 Instance list
  4. Enter username root and its password, and click Log In.
    Figure 8 Instance login
  5. Choose SQL Operations > SQL Query.
    Figure 9 SQL Query
  6. Create a database named test1.

    CREATE DATABASE test1;

    Figure 10 Creating a database
  7. Switch to test1 and create a schema named schema1 in the database.
    Figure 11 Switching to the database

    CREATE SCHEMA schema1;

    Figure 12 Creating a schema
  8. Switch to schema1 and create a table named mytable with only one column. Specify the column name as firstcol and the column type as integer.

    CREATE TABLE schema1.mytable (firstcol int);

    Figure 13 Creating a table
  9. Insert data to the table.

    INSERT INTO schema1.mytable values (100);

    Figure 14 Inserting data

    Query data in the table.

    SELECT * FROM "schema1"."mytable"

    Figure 15 Querying data
  10. In the upper part of the page, choose Account Management > Role Management.
    Figure 16 Role management
  11. Click Create Role and complete basic settings. user1 is used as an example.
    Figure 17 Creating a role
  12. Click the Permissions tab and grant user1 the permissions to perform operations on databases, schemas, and tables.
    Figure 18 Granting permissions
  13. On the Development Tool page, click Add Login and log in to the database as user1.
    Figure 19 Adding login
  14. Create schema2 in test1 to verify that user1 has the CREATE permission.
    CREATE SCHEMA schema2;
    Figure 20 Verifying permissions