Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify safeupdate usage to fit with extension changes #27892

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions apps/docs/content/guides/database/extensions/pg-safeupdate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ The `pg-safeupdate` extension is a useful tool for protecting data integrity and

## Enable the extension

`pg-safeupdate` can be enabled on a role basis (where `anon` is the role we want to modify in this example):
<Admonition type="warning" className="mt-3">

{/* prettier-ignore */}
```sql
GRANT SET ON PARAMETER session_preload_libraries TO anon;
ALTER ROLE anon SET session_preload_libraries = 'safeupdate';
```
Your project's Postgres version needs to be 15.1.1.73+ to use this extension. You can check and upgrade your project in the [Settings](https://supabase.com/dashboard/project/_/settings/infrastructure)

</Admonition>

or for all connections:
`pg-safeupdate` can be enabled on a role basis (where `anon` is the role we want to modify in this example):

{/* prettier-ignore */}
```sql
alter database some_db set session_preload_libraries = 'safeupdate';
ALTER ROLE anon SET safeupdate.enabled = on;
```

## Usage
Expand Down