Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

update date and clarify

steve-chavez17581792672c
diff --git a/apps/www/_blog/2023-05-03-postgrest-11-release.mdx b/apps/www/_blog/2023-07-06-postgrest-11.1-release.mdx
similarity index 79%
rename from apps/www/_blog/2023-05-03-postgrest-11-release.mdx
rename to apps/www/_blog/2023-07-06-postgrest-11.1-release.mdx
index 3fe32f623d9..19b37e5b6f9 100644
--- a/apps/www/_blog/2023-05-03-postgrest-11-release.mdx
+++ b/apps/www/_blog/2023-07-06-postgrest-11.1-release.mdx
@@ -10,7 +10,7 @@ tags:
- isolation level
- transactions
- roles
-date: '2023-05-03'
+date: '2023-07-06'
toc_depth: 3
---
@@ -18,9 +18,9 @@ PostgREST 11.1 is now available on the Supabase platform. Besides the [pre-relea
## Impersonated Role Settings
-Every role that passes [PostgREST JWT Authentication](https://postgrest.org/en/stable/references/auth.html#jwt-based-user-impersonation) is an impersonated role. On the Supabase platform, these are the ``anon``, ``authenticated`` and ``service_role`` roles. Plus any role you create which is member of ``authenticator`` (the role PostgREST logins with).
+Every role that passes [PostgREST JWT Authentication](https://postgrest.org/en/stable/references/auth.html#jwt-based-user-impersonation) is an *impersonated role*. On the Supabase platform, these are the ``anon``, ``authenticated`` and ``service_role`` roles. Plus any role you create that is a member of ``authenticator`` (the role PostgREST logins with).
-These roles can now have settings applied to their HTTP requests. You can set these with a regular `ALTER ROLE <role> SET <setting>`. This is useful, for example, to prevent web users from running expensive queries.
+These roles can now have settings applied with a regular `ALTER ROLE <role> SET <setting>`. This is useful, for example, to prevent web users from running expensive queries.
Let’s try it by setting a statement timeout and cost limit.
@@ -45,7 +45,7 @@ You need to reload PostgREST config cache to apply these changes.
NOTIFY pgrst, 'reload config';
```
-Now, suppose you do an expensive query. Having a big table and a filter on an unindexed column (this will cause a full table scan):
+Now, suppose you do an expensive query. Like filtering on an unindexed column on a big table (this will cause a full table scan):
```jsx
const { data, error } = await supabase
@@ -54,7 +54,7 @@ const { data, error } = await supabase
.eq('unindexed_column', 'value')
```
-Then, after 5 seconds, the request will be aborted and the response will be:
+Then, after 5 seconds, the request will be aborted with the response:
```json
{
@@ -65,11 +65,11 @@ Then, after 5 seconds, the request will be aborted and the response will be:
}
```
-Note that there's already a global ``statement_timeout`` set but you can be more fine-grained with this. See https://supabase.com/docs/guides/database/timeouts for more details.
+Which is what we wanted. Note that there's already a global ``statement_timeout`` set but you can be more fine-grained with this feature. See https://supabase.com/docs/guides/database/timeouts for more details.
### Statement Cost Limit
-With a statement timeout, expensive queries will still run for a length of time. Consuming resources until they’re terminated.
+With a statement timeout, expensive queries will still get executed for a length of time. They'll consume resources until they’re terminated.
The [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter) extension (available on the Supabase platform), brings a statement cost limit. This abort queries at the planning phase, before they get executed.
@@ -108,7 +108,7 @@ Then, immediately, the request will be aborted and the response will be:
}
```
-Tuning is required to get the cost limit right. You should use the `plan_filter.statement_cost_limit` with care as it can invalidate legitimate queries.
+Note that tuning is required to get the cost limit right. You should use the `plan_filter.statement_cost_limit` with care as it can invalidate legitimate queries.
## Configurable Transaction Isolation Level
@@ -126,7 +126,7 @@ $$ language sql
set default_transaction_isolation = 'repeatable read';
```
-Or if you want a role to run its queries with a *serializable* isolation level:
+Or if you want an impersonated role to run its queries with a *serializable* isolation level:
```sql
alter role service_role set default_transaction_isolation = 'serializable';
@@ -143,10 +143,10 @@ A long wanted feature was bulk inserting JSON while considering columns' default
Having the following sample table.
```sql
-create table foo
-( id bigint generated by default as identity primary key
-, bar text
-, baz int default 100
+create table foo (
+ id bigint generated by default as identity primary key,
+ bar text,
+ baz int default 100
);
```