I have an existing database in a RDS AWS PostgreSQL instance. I need to create one more database in this instance as spinning up a separate cluster will be expensive. There doesn't seem to be any option to create one more database inside this instance. I understand that I can create a separate schema for this purpose(like in MySQL) but I need to keep the resources for these separate and hence the need for a separate database.
Please let me know if it is possible. PostgreSQL 9.6.5
1 Answer 1
I believe you can. Based on AWS RDS FAQs:
Q: How many databases or schemas can I run within a DB instance?
- RDS for Amazon Aurora: No limit imposed by software
- RDS for MySQL: No limit imposed by software
- RDS for MariaDB: No limit imposed by software
- RDS for Oracle: 1 database per instance; no limit on number of schemas per database imposed by software
- RDS for SQL Server: 100 databases per instance
- RDS for PostgreSQL: No limit imposed by software
You can create additional database by connecting to you DB instance and do a CREATE DATABASE
. Check this guide
To create additional databases, connect to the DB instance and use the SQL command CREATE DATABASE.
And the blog post on how to create new database in an existing PostgreSQL DB Instance:
psql --host=SOME-DBMS-HOST --dbname EXISTING_DB \
--username=YOUR-USERNAME --password \
--command="CREATE DATABASE new_database WITH OWNER some_owner"
-
1The key here is make sure you connect to the EXISTING_DBbrakertech– brakertech2019年11月27日 16:27:20 +00:00Commented Nov 27, 2019 at 16:27
-
instead of connecting to the db instance and running
create database
, can it be done from a cloudformation template?A G– A G2021年04月29日 12:05:15 +00:00Commented Apr 29, 2021 at 12:05 -
Seems you cannot yet create multiple DBs with cloudformation: github.com/aws/aws-cdk/issues/13588Freddie– Freddie2022年01月21日 08:48:30 +00:00Commented Jan 21, 2022 at 8:48