Before you start to use ApsaraDB for RDS, you must create databases and accounts on your RDS instance. This topic describes how to create a database on an ApsaraDB RDS for PostgreSQL instance.

Precautions

  • If your RDS instance uses standard or enhanced SSDs, you can create and manage databases by using the ApsaraDB for RDS console.
  • If your RDS instance uses local SSDs, you can create and manage databases by using SQL statements.
  • If you want to migrate data from an on-premises database to your RDS instance, you must create a database and an account on your RDS instance. Make sure that the database and the account have the same names as the on-premises database and its authorized account.

Create a database on an RDS instance equipped with standard or enhanced SSDs

  1. Log on to the ApsaraDB for RDS console.
  2. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where the target RDS instance resides.
    Select a region
  3. Find the target instance and click the instance ID.
  4. In the left-side navigation pane, click Databases.
  5. Click Create Database.
  6. Configure the following parameters.
    Create a database on an RDS instance equipped with standard or enhanced SSDs
    Parameter Description
    Database Name:
    • The name of the database can contain up to 64 characters.
    • The name of the database can contain lowercase letters, digits, hyphens (-), and underscores (_).
    • The name of the database must start with a lowercase letter and end with a lowercase letter or digit.
    Supported Character Sets: Specify the character set that is supported by the database.
    Collate Specify the rule that is used to collate strings in the database.
    Ctype Specify the type of character that is supported by the database.
    Authorized Account: Specify the owner of the database. The owner has all permissions on the database.
    Description: Enter the description of the database.
  7. Click Create.

Create a database on an RDS instance equipped with local SSDs

  1. Connect to the RDS instance. For more information, see Connect to an ApsaraDB RDS for PostgreSQL instance.
  2. In the SQL window, execute the following statement to create a database:
    CREATE DATABASE name
     [ [ WITH ] [ OWNER [=] user_name ]
            [ TEMPLATE [=] template ]
            [ ENCODING [=] encoding ]
            [ LC_COLLATE [=] lc_collate ]
            [ LC_CTYPE [=] lc_ctype ]
            [ TABLESPACE [=] tablespace_name ]
            [ CONNECTION LIMIT [=] connlimit ] ]

    For example, if you want to create a database named test, execute the following statement.

    create database test;

What to do next

Connect to an ApsaraDB RDS for PostgreSQL instance.