mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 10:14:22 +08:00
also removes tips for changing timezone and resetting project password and just point to the respective guides we have for those.
131 lines
4.5 KiB
Plaintext
131 lines
4.5 KiB
Plaintext
---
|
|
id: database
|
|
title: Database
|
|
description: Use Supabase to manage your data.
|
|
sidebar_label: Overview
|
|
---
|
|
|
|
Every Supabase project comes with a full [Postgres](https://www.postgresql.org/) database, a free and open source
|
|
database which is considered one of the world's most stable and advanced databases.
|
|
|
|
## Postgres or PostgreSQL?
|
|
|
|
PostgreSQL the database was derived from the POSTGRES Project, a package written at the University of California at Berkeley in 1986.
|
|
This package included a query language called "PostQUEL".
|
|
|
|
In 1994, Postgres95 was built on top of POSTGRES code, adding an SQL language interpreter as a replacement for PostQUEL.
|
|
Eventually, Postgres95 was renamed to PostgreSQL to reflect the SQL query capability.
|
|
|
|
After this, many people referred to it as Postgres since it's less prone to confusion. Supabase is all about
|
|
simplicity, so we also refer to it as Postgres.
|
|
|
|
## Features
|
|
|
|
### Table View
|
|
|
|
You don't have to be a database expert to start using Supabase. Our table view makes Postgres as easy to use as a spreadsheet.
|
|
|
|

|
|
|
|
### Relationships
|
|
|
|
Dig into the relationships within your data.
|
|
|
|
<video width="99%" loop="" muted="" playsInline="" controls="true">
|
|
<source src="/docs/videos/relational-drilldown-zoom.mp4" type="video/mp4" />
|
|
</video>
|
|
|
|
### Clone tables
|
|
|
|
You can duplicate your tables, just like you would inside a spreadsheet.
|
|
|
|
<video width="99%" muted playsInline controls={true}>
|
|
<source
|
|
src="/docs/videos/duplicate-tables.mp4"
|
|
type="video/mp4"
|
|
muted
|
|
playsInline
|
|
/>
|
|
</video>
|
|
|
|
### The SQL Editor
|
|
|
|
Supabase comes with a SQL Editor. You can also save your favorite queries to run later!
|
|
|
|
<video width="99%" muted playsInline controls={true}>
|
|
<source src="/docs/videos/favorites.mp4" type="video/mp4" muted playsInline />
|
|
</video>
|
|
|
|
### Additional features
|
|
|
|
- Supabase extends Postgres with realtime functionality using our [Realtime Server](https://github.com/supabase/realtime).
|
|
- Every project is a full Postgres database, with `postgres` level access.
|
|
- Supabase manages your database backups.
|
|
- Import data directly from a CSV or excel spreadsheet.
|
|
|
|
:::info
|
|
Database backups **do not** include objects stored via the Storage API, as the database only includes metadata about these objects. Restoring an old backup does not restore objects that have been deleted since then.
|
|
:::
|
|
|
|
### Extensions
|
|
|
|
To expand the functionality of your Postgres database, you can use extensions.
|
|
You can enable Postgres extensions with the click of a button within the Supabase dashboard.
|
|
|
|
<video width="99%" muted playsInline controls={true}>
|
|
<source
|
|
src="/docs/videos/toggle-extensions.mp4"
|
|
type="video/mp4"
|
|
muted
|
|
playsInline
|
|
/>
|
|
</video>
|
|
|
|
[Learn more](/docs/guides/database/extensions) about all the extensions provided on Supabase.
|
|
|
|
## Tips
|
|
|
|
### Realtime
|
|
|
|
Supabase provides a realtime engine on top of Postgres, so that you can listen to changes as they happen.
|
|
Our realtime engine uses the built-in replication functionality of Postgres.
|
|
|
|
Realtime server broadcasts database changes to authorized users depending on your Row Level Security (RLS) policies.
|
|
We recommend that you enable row level security and set row security policies on tables that you add to the publication.
|
|
However, you may choose to disable RLS on a table and have changes broadcast to all connected clients.
|
|
|
|
You can manage the realtime system, simply by
|
|
[updating](/docs/guides/database/replication) the `supabase_realtime` publication.
|
|
|
|
For example to enable realtime only for individual tables:
|
|
|
|
```sql
|
|
begin;
|
|
-- remove the realtime publication
|
|
drop publication if exists supabase_realtime;
|
|
|
|
-- re-create the publication but don't enable it for any tables
|
|
create publication supabase_realtime;
|
|
commit;
|
|
|
|
-- add a table to the publication
|
|
alter publication supabase_realtime add table products;
|
|
|
|
-- add other tables to the publication
|
|
alter publication supabase_realtime add table posts;
|
|
```
|
|
|
|
By default only "new" values are sent, but if you want to receive the old record (previous values) whenever you `update` or `delete` a record,
|
|
you can update the replica identity of your tables, setting it to `full`:
|
|
|
|
```sql
|
|
alter table your_table replica identity full;
|
|
```
|
|
|
|
Read about resetting your database password [here](/docs/guides/database/managing-passwords) and changing the timezone of your server [here](/docs/guides/database/managing-timezones).
|
|
|
|
## Next steps
|
|
|
|
- Read more about [Postgres](/docs/postgres/server/about)
|
|
- Sign in: [app.supabase.com](https://app.supabase.com)
|