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).
- Step 1: Create a FlexusRDS for PostgreSQL Instance
- Step 2: Connect to the FlexusRDS for PostgreSQL Instance
Preparations
- Sign up for a HUAWEI ID and enable Huawei Cloud services.
- Before purchasing DB instances, ensure that your account balance is sufficient. Top up your account if required.
- 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
- Go to the FlexusRDS console.
- If this is your first time to create a FlexusRDS for PostgreSQL instance, click Buy.
- Configure the instance information and click Buy.
Figure 1 Selecting an instance classFigure 2 Selecting the required duration
Parameter
Example Value
Description
Region
CN-Hong Kong
The 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, they will be named instance-0001, instance-0002, and so on. (instance indicates the DB instance name you specify.)
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.
- Confirm the order and click Pay Now.
Figure 3 Order confirmation
- Select a payment method and complete the payment.
- 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
- In the instance list, locate the instance and click Reset Password in the Operation column.
Figure 5 Instance list
- Enter a new password, confirm the password, and click OK.
Figure 6 Resetting a password
- In the instance list, locate the instance and click Log In in the Operation column.
Figure 7 Instance list
- Enter username root and its password, and click Log In.
Figure 8 Instance login
- Choose SQL Operations > SQL Query.
Figure 9 SQL Query
- Create a database named test1.
CREATE DATABASE test1;
Figure 10 Creating a database - 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 - 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 - Insert data to the table.
INSERT INTO schema1.mytable values (100);
Figure 14 Inserting dataQuery data in the table.
SELECT * FROM "schema1"."mytable"
Figure 15 Querying data - In the upper part of the page, choose Account Management > Role Management.
Figure 16 Role management
- Click Create Role and complete basic settings. user1 is used as an example.
Figure 17 Creating a role
- Click the Permissions tab and grant user1 the permissions to perform operations on databases, schemas, and tables.
Figure 18 Granting permissions
- On the Development Tool page, click Add Login and log in to the database as user1.
Figure 19 Adding login
- Create schema2 in test1 to verify that user1 has the CREATE permission.
CREATE SCHEMA schema2;Figure 20 Verifying permissions
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot