Example: Buy and Connect to an RDS for PostgreSQL DB Instance
This example illustrates how to purchase an RDS for PostgreSQL instance and how to connect to it using DAS.
Step 1: Create an RDS for PostgreSQL Instance
- Go to the Buy DB Instance page.
- Configure the instance information and click Next.
Figure 1 Selecting a billing mode, DB engine, storage type, and instance type
Figure 2 Selecting an instance class
Figure 3 Configuring network information
Figure 4 Setting a password
- View the purchased RDS instance.
Figure 5 Instance successfully purchased
Step 2: Connect to the RDS for PostgreSQL Instance
- Click Log In in the Operation column.
Figure 6 Instances
- Enter the root password you configured during instance creation and click Log In.
Figure 7 Instance login
- Choose SQL Operations > SQL Query.
Figure 8 SQL Query
- Create a database named test1.
CREATE DATABASE test1;
Figure 9 Creating a database
- Switch to test1 and create a schema named schema1 in the database.
Figure 10 Switching to the database
CREATE SCHEMA schema1;
Figure 11 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 12 Creating a table
- Insert data to the table.
INSERT INTO schema1.mytable values (100);
Figure 13 Inserting data
Query data in the table.
SELECT * FROM "schema1"."mytable"
Figure 14 Querying data
- In the upper part of the page, choose Account Management > Role Management.
Figure 15 Role management
- Click Create Role and complete basic settings. user1 is used as an example.
Figure 16 Creating a role
- Click the Permissions tab and grant user1 the permissions to perform operations on databases, schemas, and tables.
Figure 17 Granting permissions
- On the Development Tool page, click Add Login and log in to the database as user1.
Figure 18 Adding login
- Create schema2 in test1 to verify that user1 has the CREATE permission.
CREATE SCHEMA schema2;Figure 19 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