Docs

Postgres in Sovaria

The Postgres version and extensions your project has, schemas, data types, keys and constraints, views, functions and triggers, what the plan limits, and which Postgres features behave differently through the API.

Updated Nov 25, 2026

Every project has its own PostgreSQL database: 18 for new projects (asynchronous I/O, built-in uuidv7()), 16 for projects made before (Sovaria upgrades them one at a time; nothing changes for you until then). Everything you know about Postgres applies: SQL, schemas, constraints, views, functions, triggers, indexes and transactions. Sovaria adds the API, access policies and auth helpers around it.

#Extensions

About 30 extensions are available: vector for embeddings, postgis for geography, pg_trgm for fuzzy search, pgcrypto, citext, pg_graphql, pg_stat_statements and more. Turn them on under Schema › Extensions. Extensions lists each one, what it is for and which plan includes it; network and file extensions (dblink, postgres_fdw) aren't offered.

#Schemas, tables and the rest

  • Your tables live in public by default; create more schemas to group them. The auth schema holds the auth helpers (Auth helpers in SQL); don't create tables there.
  • Use the types you need: uuid and bigint generated always as identity for keys, timestamptz for times, jsonb for flexible data, numeric for money, arrays, enums.
  • Primary keys, foreign keys (with on delete cascade or set null), unique and check constraints and defaults all work, and the Table Editor sets most of them for you.
  • Views (use with (security_invoker = true) so they respect row-level security) and materialized views are supported.
  • SQL and PL/pgSQL functions, triggers and indexes: create and manage them under Schema — see Database functions, Triggers and Indexes.
FreeProUltraTeamEnterprise
Tables1002,00010,00050,000200,000
Views255002,00010,00050,000
Stored procedures205002,00010,00050,000
Triggers205002,00010,00050,000
Indexes10010,00030,000100,000500,000
Schemas per database5502001,0005,000
Database disk500 MB8 GB25 GB100 GB1 TB

#Schemas Sovaria manages

A few schemas in your project's database belong to Sovaria. They are part of your database — no other project can see them, and they hold nothing from other projects — but Sovaria creates and changes them, so don't create objects there or rely on what is inside.

SchemaHoldsIn the console
authThe auth helpers you use in policies: auth.uid(), auth.role(), auth.jwt() (Auth helpers in SQL).Listed, read-only in the Table Editor.
sovaria_internalYour plan's object limits (tables, functions, triggers, indexes…) and the check that enforces them on every schema change, from any client.Hidden. Only Sovaria can change it.
sovaria_trashTables and column values deleted from the Table Editor, kept so Version history: see, undo and restore changes can bring them back. Sovaria may delete trash older than its undo window (30 days); after that the drop can't be undone.Hidden. Undo a change to restore what is there.

Sovaria also keeps a few helpers in your own schema for documents and Table history (time travel) (sov_documents, sov_history, sov_as_of()…). They don't count against your limits, and Schema › Functions hides them unless you choose to show them.

#Through the API

TopicHow it works
One statement per request/api/v1/sql/query runs one SELECT, INSERT, UPDATE, DELETE or EXPLAIN; schema changes belong in the SQL editor or migrations.
ValuesAlways as parameters ($1, $2…), never pasted into SQL.
Rows per queryCapped by plan (below); page through larger results.
Statement timeA default timeout per plan; a client may ask for more with X-Statement-Timeout-Ms, up to the plan's maximum.
Transactions across requestsPOST /api/v1/data/rel/transaction/begin, then pass the txid and commit or rollback (HTTP API: tables, migrations and history).
Session stateset_config, SET ROLE and changing the request's identity are refused.

A query returns at most your plan's sql.max_rows rows, and the answer carries "truncated": true when there were more (the SQL editor says so). For a single SELECT, WITH, VALUES or TABLE statement whose parameters, if any, are text or null, your database sends at most one row more than that (to tell whether there were more); the statement still runs to the end there, so functions it calls behave as they would without the limit. Page with LIMIT/OFFSET or a keyset WHERE. Send "read_only": true with a query to have it run in a read-only transaction.

FreeProUltraTeamEnterprise
Rows one SQL query may return1,0005,00010,00025,00050,000
Default SQL statement timeout (ms)3 s8 s15 s30 s60 s
Longest SQL statement timeout a client may request (ms)8 s30 s60 s120 s300 s
Concurrent database connections202005002,00010,000

#Database errors

Postgres errorMeans
23505 unique_violationA row with that value already exists.
23503 foreign_key_violationThe referenced row doesn't exist, or other rows still point to it.
23502 not_null_violationA required column was empty.
23514 check_violationA check constraint refused the value.
42501 insufficient_privilege / new row violates row-level securityA row-level security policy refused the row (Row-level security and access).
57014 query_canceledThe statement timeout stopped it — add an index or raise the timeout.
42P01 undefined_table (404 from /rest/v1)Wrong table name or schema (names are case-sensitive when quoted), or the table was made in another environment: staging and branches have their own database, so create it in production too.

#Coming from Firebase or Supabase?

PlatformWhat this is called there
FirebaseFirebase Data Connect (Cloud SQL for PostgreSQL)
SupabaseSupabase Database (Postgres)
SovariaPostgres in Sovaria

Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.