Database
Use Supabase to connect, manage, and secure your Postgres database.
Every Supabase project gets a full Postgres database, not a Postgres abstraction. This database is the foundation that Auth, Storage, Realtime, and Edge Functions are built on, and Supabase manages daily database backups and offers point-in-time recovery on paid plans.
Work with your project's database in the following ways:
- Visually using the Table Editor section of the Dashboard.
- With query syntax using the SQL Editor section of the Dashboard.
- Programmatically using a variety of different methods.
Get started#
If you're new to the database section, these are the pages to read first:
- Connection strings, the Supavisor connection pooler, and when to use direct, transaction, or session mode.
Connect to your database
- Create tables and relationships, and edit rows from the Dashboard.
Tables and data
- Load existing data from CSV files, `pg_dump`, or another Postgres database.
Import data
- Row Level Security (RLS) is how Supabase makes the database safe to query directly from the client. Read this before exposing any table to your app.
Secure your data
- Add Postgres extensions from the Dashboard, including `pgvector` for embeddings, `PostGIS` for geospatial data, and `pg_cron` for scheduled jobs.
Extensions
- Use the Dashboard's SQL Editor for ad-hoc queries and saved snippets.
Run SQL commands
Next steps#
Once you've covered the basics, these guides help with other use cases and features:
- Run logic inside the database in response to inserts, updates, or deletes.
Database functions
- Run logic inside the database in response to inserts, updates, or deletes.
Triggers
- Send row changes to an external HTTP endpoint.
Database webhooks
- Stream changes to other systems or read from a geographically closer replica.
Replication and read replicas
- Daily backups on every project, with point-in-time recovery on paid plans. Backups cover the database itself; objects stored through the Storage API are not included.
Backups
- Indexes, the query planner, and tools for finding slow queries.
Query performance and optimization
- The Postgres roles Supabase ships with and how to add your own.
Roles and permissions