The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
clarify
steve-chavez5027727232ad
diff --git a/apps/www/_blog/2023-04-20-postgrest-11.mdx b/apps/www/_blog/2023-04-20-postgrest-11.mdxindex 6ffe0944a01..50bebccfa02 100644--- a/apps/www/_blog/2023-04-20-postgrest-11.mdx+++ b/apps/www/_blog/2023-04-20-postgrest-11.mdx@@ -28,13 +28,13 @@ Let’s try it by setting a statement timeout and cost limit.`statement_timeout` aborts any statement that takes more than the specified amount of time. Let’s set it for the usual `anon`, `authenticated` and `service_role` roles:```sql--- anon users can only run queries that take 100 milliseconds max+-- anonymous users can only run queries that take 100 milliseconds maxalter role anon set statement_timeout = '100ms';-- authenticated users can only run queries that take 5 seconds maxalter role authenticated set statement_timeout = '5s';--- service_role users can only run queries that take 15 seconds max+-- backend-only users can only run queries that take 15 seconds maxalter role service_role set statement_timeout = '15s';```@@ -69,13 +69,13 @@ Then, after 5 seconds, the request will be aborted and the response will be:With `statement_timeout`, queries will still run for that length of time, consuming resources until they’re terminated. To prevent this, you can abort queries based on their plan cost — this is determined at the planning phase, before they get executed.```sql--- anon users can only run cheap queries+-- anonymous users can only run cheap queriesALTER USER anon SET plan_filter.statement_cost_limit = 10000;-- authenticated users can run more expensive queriesALTER USER authenticated SET plan_filter.statement_cost_limit = 1e6;--- service_role can run any query+-- backend-only users can run any queryALTER USER service_role SET plan_filter.statement_cost_limit = 0;NOTIFY pgrst, 'reload config'; -- reload postgREST config cache to apply changes@@ -109,7 +109,7 @@ By default, all queries in PostgREST run in a transaction with the default *Read```sqlBEGIN ISOLATION LEVEL READ COMMITTED;--- <query>+-- <your_query>COMMIT;```