Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b82b3f1
enable safeupdate for anon, authenticator and authenticator roles by …
encima Apr 3, 2026
85247b5
fix: update oriole tests for roles
encima Apr 3, 2026
8ea8b79
modify session_preload_libraries for anon, authenticator and authenti…
encima Apr 14, 2026
4f0a4ee
remove session preload libraries from anon and authenticated
encima Apr 14, 2026
bda4300
Merge branch 'develop' into feat/enable-safeupdate-plugin
encima Apr 14, 2026
04f4c15
restrict migration changes to postgres role
encima Apr 15, 2026
f678eab
fix: oriole test
encima Apr 15, 2026
5dd89a7
fix: remove supautils from migration
encima Apr 15, 2026
4fd6386
symlink safeupdate to original path so as not to break any Data API u…
encima Apr 17, 2026
80e2da6
fix formatting
encima Apr 17, 2026
e730a8a
symlink should be postbuild
encima Apr 17, 2026
b7c6774
Update nix/ext/pg-safeupdate.nix
encima Apr 17, 2026
f7734f1
merge with develop
encima Apr 28, 2026
0195506
Merge branch 'develop' into feat/enable-safeupdate-plugin
encima Apr 29, 2026
ebae352
Merge branch 'develop' into feat/enable-safeupdate-plugin
brainrake Jul 18, 2026
7d64ea4
Merge branch 'develop' into feat/enable-safeupdate-plugin
brainrake Oct 10, 2026
4a153fd
fix(migrations): set safeupdate on postgres role via session_preload_…
brainrake Oct 10, 2026
1b65b33
test(nix): check safeupdate blocks unqualified update for postgres role
brainrake Oct 10, 2026
27fc87c
Merge branch 'develop' into feat/enable-safeupdate-plugin
brainrake Oct 21, 2026
dfee55a
Merge branch 'develop' into feat/enable-safeupdate-plugin
encima Oct 26, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- migrate:up
ALTER ROLE postgres SET session_preload_libraries = supautils, safeupdate;

ALTER ROLE postgres SET safeupdate.enabled = 0;

-- migrate:down
7 changes: 7 additions & 0 deletions nix/tests/expected/pg-safeupdate.out
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ update v.foo
ERROR: UPDATE requires a WHERE clause
drop schema v cascade;
NOTICE: drop cascades to table v.foo
alter role postgres in database postgres set safeupdate.enabled = 1;
\c - postgres
create temp table t(id int);
update t set id = 1;
ERROR: UPDATE requires a WHERE clause
\c - supabase_admin
alter role postgres in database postgres reset safeupdate.enabled;
6 changes: 3 additions & 3 deletions nix/tests/expected/roles.out
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ select
from pg_roles r
where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections')
order by rolname;
rolname | rolconfig
----------------------------+------------------------------------------------------------------------------------------
rolname | rolconfig
----------------------------+-----------------------------------------------------------------------------------------------------------------------
anon | {statement_timeout=3s}
authenticated | {statement_timeout=8s}
authenticator | {"session_preload_libraries=supautils, safeupdate",statement_timeout=8s,lock_timeout=8s}
Expand All @@ -83,7 +83,7 @@ order by rolname;
pgsodium_keyiduser |
pgsodium_keymaker |
pgtle_admin |
postgres | {"search_path=\"\\$user\", public, extensions"}
postgres | {"search_path=\"\\$user\", public, extensions","session_preload_libraries=supautils, safeupdate",safeupdate.enabled=0}
service_role |
supabase_admin | {"search_path=\"$user\", public, auth, extensions",log_statement=none}
supabase_auth_admin | {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none}
Expand Down
6 changes: 3 additions & 3 deletions nix/tests/expected/z_multigres-orioledb-17_roles.out
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ select
from pg_roles r
where rolname not in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections')
order by rolname;
rolname | rolconfig
----------------------------+------------------------------------------------------------------------------------------
rolname | rolconfig
----------------------------+-----------------------------------------------------------------------------------------------------------------------
anon | {statement_timeout=3s}
authenticated | {statement_timeout=8s}
authenticator | {"session_preload_libraries=supautils, safeupdate",statement_timeout=8s,lock_timeout=8s}
Expand All @@ -77,7 +77,7 @@ order by rolname;
pg_write_server_files |
pgbouncer |
pgtle_admin |
postgres | {"search_path=\"\\$user\", public, extensions"}
postgres | {"search_path=\"\\$user\", public, extensions","session_preload_libraries=supautils, safeupdate",safeupdate.enabled=0}
service_role |
supabase_admin | {"search_path=\"\\$user\", public, auth, extensions",log_statement=none}
supabase_auth_admin | {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none}
Expand Down
10 changes: 10 additions & 0 deletions nix/tests/sql/pg-safeupdate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ update v.foo
set val = 'bar';

drop schema v cascade;

alter role postgres in database postgres set safeupdate.enabled = 1;

\c - postgres
create temp table t(id int);

update t set id = 1;

\c - supabase_admin
alter role postgres in database postgres reset safeupdate.enabled;
Loading