Create a database
Add a PostgreSQL database to a project, choose its version and extensions, and manage several databases in one project.
Every database in the Console is a real PostgreSQL database with its own name, its own login role and its own connection details. A project can have more than one.
Create the first database
If you made a Blank Project, the project has no database. Open Databases in the sidebar. You will see a message that no database is provisioned and a Create Database button.
If you chose Add Database when you created the project, it already has a primary database. See Create your first project.
Create another database
- Open the project and choose Databases.
- Choose + New Database, Create Database, or + Create New Database... in the database picker (the same option is in the top bar).
- In Create Additional Database, enter a Database Label. This is a friendly name inside the project.
- Under PostgreSQL Database Name, accept the suggestion or type your own. The name is checked for availability as you type.
- Choose the PostgreSQL Engine Version. See PostgreSQL versions and upgrades.
- Optional: tick Database Extensions to switch on when the database is created. Extensions that do not support the chosen version are greyed out with an Incompatible with chosen PostgreSQL version note. See Extensions.
- Choose Provision Database.
When it finishes you see a message with the database label and name.
Naming rules
- Lowercase letters, numbers, underscores and hyphens, starting with a letter.
- Unique across the whole platform, not only your project, so a very common name may already be taken. If a name is taken, the form tells you; try another.
- Names beginning with
pg_,_pgb,pgb_ortemplate, and platform system names, are reserved.
Alongside the database, an application role named after it (<name>_app) and credentials are created for you.
Your databases at a glance
Databases > Fleet Instances lists every database in the project with its label, identifier, role (Primary or Additional), engine version and status, plus shortcuts to Connect, SQL, Tables, Backups, Metrics and Settings. Set Primary changes which database is primary; it never deletes tables, data or credentials, and you can switch back. The database picker in the sidebar and top bar changes which database every database page shows.
Limits
- Accounts have a default guardrail on the number of databases. Usage & Billing shows Active Databases as "used / max". If you need more, choose Request Increase and describe your use case. See Usage and the free allowance.
- New databases cannot be created while your account is paused for unpaid usage.
- Your role must allow writing data. Viewer and Billing roles cannot create databases.
Good to know
- Storage and compute are pooled across all your databases for the free allowance and billed beyond it. See Usage and the free allowance.
- Daily backups are on by default for each database. See Daily snapshots.
- Next: connect to it.
More guides in Console: databases
Connection strings, direct and pooled connections
Find your host, port and credentials, choose between the pooled, regular and direct connection, and test that they work.
Your database's own address
Use the per-database address shown on the Connection page, what is faster about it, and how to rename it safely.
The SQL editor
Run queries and scripts against your database from the Console, use templates and history, and understand the safety limits.
Import data into a database
Bring a database over from another host, or upload a .sql or .sql.gz dump, from the Backups page.
Extensions
See which PostgreSQL extensions are available for your database, enable or disable them and understand "needs approval".
PostgreSQL versions and upgrades
Choose a version when you create a database and upgrade to a newer one from DB Settings, with a verified copy.