- Creating a new Postgres database
- Cluster configuration options
- Connecting to your database
Prerequisites
Before you begin, make sure you have a PlanetScale account. After you create an account, you’ll be prompted to create a new organization, which is essentially a container for your databases, settings, and members. After creating your organization, it’s important to understand the relationship between databases, branches, and clusters.- Database: Your overall project (e.g., “my-ecommerce-app”)
- Branch: Isolated database deployments that provide you with separate environments for development and testing, as well as restoring from backups - learn more about branching
- Cluster: The underlying compute and storage infrastructure that powers each branch
Create a new database
- Dashboard
- CLI
Step 1: Navigate to database creation
1
Log in to your PlanetScale dashboard
2
Select your organization from the dropdown
3
Click “New database” button or navigate to
/newStep 2: Choose database engine
1
On the database creation form, you’ll see two engine options:
- Vitess (MySQL-compatible)
- Postgres (PostgreSQL-compatible)
2
Select Postgres to create a PostgreSQL database
Step 3: Configure your database cluster
1
Database name: Enter a unique name for your database
This “name” is referenced in the PlanetScale Dashboard and APIs and not created as a logical database inside of Postgres.
2
Region: Choose the primary region where your database will be hosted
3
Cluster configuration: Select your preferred cluster size and CPU architecture
Step 4: Create the database cluster
1
Review your configuration settings
2
Click “Create database” to provision your Postgres database
3
Your database will be created with a
main branch by defaultWhat happens during creation
When you create a Postgres database cluster, PlanetScale automatically:- Provisions a PostgreSQL cluster in your selected region
- Creates the initial
mainbranch - Prepopulates Postgres with required default databases
- Sets up monitoring and metrics collection
- Configures backup and high availability settings
Create credentials and connect
In this section you’ll create the “Default role” in your PlanetScale dashboard to create connection credentials for your database branch.The “Default role” is meant purely for administrative purposes. You can only create one and it has significant privileges for your database cluster and you should treat these credentials carefully. After completing this quickstart, it is strongly recommended that you create another role for your application use-cases.
- Dashboard
- CLI

