PostgreSQL

Create your project's PostgreSQL database, work with tables and SQL, and choose a size.

Last updated

Create the database

  1. In your project, open Backend Cloud and choose Set up Backend Cloud (or PostgreSQL › Create database).
  2. The summary shows the size you will get. Confirm.
  3. The setup page follows the database until it is ready, also after a reload.

Work with your data

The PostgreSQL page has these tabs that work today:

  • Overview: size, usage against your limits, this month's measured usage, and charts for transactions per second, active connections, cache hit ratio and database size.
  • Tables: list tables, see columns and the first 100 rows, Insert row, Edit, Delete, and Change structure (add a column, rename, change type, index, relationship). New tables use row-level security and deny client access by default.
  • Schema: the schema visualizer.
  • SQL Editor: run one statement at a time, within a time limit, with up to 200 rows returned. Errors show the database's error code.
  • Extensions: pgcrypto, uuid-ossp, citext, hstore.
  • Migrations: named SQL statements applied in one transaction.
  • Backups: see Backups and restore.
  • Activity: backups, restores, credential rotations and size readings.
  • Settings: size, pool settings, SSL and network restrictions.

Backend Cloud › Policies creates, edits and deletes row-level security policies from four templates and turns row-level security on or off.

Note: Not available yet: the Functions, Triggers, Enumerated types, Publications, Roles, Pipelines and Advisors tabs, Create index and Index Advisor, slow query text and Download CSV.

Sizes

SizeStorageConnectionsAdded storageAvailable
Free512 MB10NoneYes
Nano512 MB10Up to 2 GBYes
Small2 GB30Up to 8 GBNot yet
Medium8 GB60Up to 24 GBNot yet
  • Each organization has one Free database. Your first PostgreSQL database is Free; later ones start as Nano.
  • Storage is added in 1 GB steps with Add storage (+1 GB) and Remove 1 GB on Settings › Size and limits.
  • Change size is for managers. A change that lowers the storage cap is refused when your data would not fit.
  • Small and Medium are not offered in Mumbai yet: choosing one answers size_not_available.
  • The shared database server may hold fewer connections than a size lists; the card then says how many are enforced.

Note: These sizes and limits are not final.

When a database reaches its storage cap it becomes read-only: writes are refused with database_storage_full, reads keep working, and deleting rows, TRUNCATE and DROP stay allowed so you can make room. The Usage card warns from 80 %.

With the API

HTTP
POST /v1/projects/{projectId}/backend?organizationId={organizationId}
Content-Type: application/json
Idempotency-Key: backend-acme-1

{ "size": "nano" }

Without a body the size is chosen for you (Free first, then Nano). Read and change the size with GET and PATCH /v1/projects/{projectId}/backend/size, for example { "size": "small", "extraStorageGiB": 2 }.

Run SQL from the API with POST …/backend/sql.