Storage

The Storage Schema

Learn about the storage schema


Storage uses Postgres to store metadata regarding your buckets and objects. Users can use RLS (Row-Level Security) policies for access control. This data is stored in a dedicated schema within your project called storage.

Here is the schema that represents the Storage service:

buckets PK text id text name timestamptz created_at timestamptz updated_at boolean public bigint file_size_limit text[] allowed_mime_types text owner_id objects PK uuid id FK text bucket_id text name timestamptz created_at timestamptz updated_at jsonb metadata text[] path_tokens text version text owner_id migrations PK integer id varchar(100) name varchar(40) hash timestamp executed_at buckets_id:id

You have the option to query this table directly to retrieve information about your files in Storage without the need to go through our API.

Modifying the schema#

We strongly recommend refraining from making any alterations to the storage schema and treating it as read-only. This approach is important because any modifications to the schema on your end could potentially clash with our future updates, leading to downtime.

However, we encourage you to add custom indexes as they can significantly improve the performance of the RLS policies you create for enforcing access control.