Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Relational Database Service/ Getting Started/ Getting Started with RDS for PostgreSQL/ Buying an RDS for PostgreSQL Instance and Connecting to It Through DAS

Buying an RDS for PostgreSQL Instance and Connecting to It Through DAS

Updated on 2025-01-10 GMT+08:00

This section describes how to purchase an RDS for PostgreSQL instance and how to connect to it using DAS.

Step 1: Buy an RDS for PostgreSQL DB Instance

  1. Go to the Buy DB Instance page.
  2. On the Quick Config page, set basic parameters.
    NOTE:

    The following parameter settings are only for reference.

    Parameter

    Example Value

    Description

    Billing Mode

    Pay-per-use

    The billing mode of an instance.

    • Yearly/Monthly: A prepaid billing mode in which you pay for resources before using it. Bills are settled based on the subscription period. The longer the subscription, the bigger the discount. This mode is a good option for long-term, stable services.
    • Pay-per-use: A postpaid billing mode. You pay as you go and just pay for what you use. The DB instance usage is calculated by the second but billed every hour. This mode allows you to adjust resource usage easily. You neither need to prepare for resources in advance, nor end up with excessive or insufficient preset resources.

    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 Version

    16

    The database version.

    DB Instance Type

    Primary/Standby

    The architecture type of an instance.

    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.

    Instance Class

    General-purpose | 4U | 8G

    The vCPU and memory of an instance.

    Storage

    Cloud SSD | 100GB

    The storage space of an instance.

    It contains the system overhead required for inodes, reserved blocks, and database operation.

    Disk Encryption

    Disable

    Enabling disk encryption improves data security, but slightly affects the read and write performance of the database.

    If a shared KMS key is used, the corresponding CTS events are createdatakey and decrydatakey. Only the key owner can receive the events.

  3. Complete advanced configurations.
    Figure 1 Additional Options

    Parameter

    Example Value

    Description

    VPC

    default_vpc

    The virtual network in which your instance is located. A VPC can isolate networks for different workloads.

    If no VPC is available, click Create VPC. After a VPC is created, click . For details, see Creating a VPC and Subnet.

    Subnet

    default_subnet

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

    Security Group

    default

    It can enhance security by controlling access to RDS for PostgreSQL from other services.

    Enterprise Project

    default

    If your account has been associated with an enterprise project, select the target project from the Enterprise Project drop-down list.

    For more information about enterprise projects, see Enterprise Management User Guide.

    Quantity

    1

    The number of instances to be created in a batch.

  4. Click Buy.
  5. Check the purchased DB instance.
    Figure 2 Instance successfully purchased

Step 2: Connect to the RDS for PostgreSQL Instance

  1. Since no password is configured in Step 1: Buy an RDS for PostgreSQL DB Instance, you need to reset the password before you can connect to the instance. In the instance list, choose More > Reset Password.
    Figure 3 Instance list
  2. Enter a new password, confirm the password, and click OK.
    Figure 4 Resetting a password
  3. Click Log In in the Operation column.
    Figure 5 Instance list
  4. Enter the required information and click Log In.
    • Login Username: Enter root.
    • Database Name: Enter postgres.
    • Password: Enter the password you specified in 2.
    Figure 6 Logging in to an instance
  5. Choose SQL Operations > SQL Query.
    Figure 7 SQL Query
  6. Create a database named test1.

    CREATE DATABASE test1;

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

    CREATE SCHEMA schema1;

    Figure 10 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 11 Creating a table
  9. Insert data to the table.

    INSERT INTO schema1.mytable values (100);

    Figure 12 Inserting data

    Query data in the table.

    SELECT * FROM "schema1"."mytable"

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

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback