All Products
Document Center

Create a PostgreSQL schema

Last Updated: Apr 23, 2019

In DLA, the statements for creating ApsaraDB RDS for SQL Server (SQL Server) and ApsaraDB RDS for PostgreSQL (PostgreSQL) schemas and tables are the same to those for ApsaraDB RDS for MySQL. Database is equivalent to schema in MySQL, and thus ApsaraDB RDS for MySQL (MySQL) contains only schema or database. However, SQL Server and PostgreSQL contain both databases and schemas. Therefore, the statement for creating schemas is slightly different from that for MySQL.

Create a PostgreSQL schema

  1. CREATE SCHEMA `hello_postgresql_vpc_rds` WITH DBPROPERTIES
  2. (
  3. CATALOG = 'postgresql',
  4. LOCATION = 'jdbc:postgresql://',
  5. USER='rds_postgresql_username',
  6. PASSWORD='rds_postgresql_password',
  7. INSTANCE_ID = 'rds_postgresql_instance_id',
  8. VPC_ID = 'rds_postgresql_vpcid'
  9. );

Next step

Create a PostgreSQL table