Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- supautils
postgres: [13, 14, 15, 16, 17]
box:
- { runner: ubuntu-20.04, arch: amd64 }
- { runner: ubuntu-latest, arch: amd64 }
- { runner: arm-runner, arch: arm64 }
runs-on: ${{ matrix.box.runner }}
steps:
Expand Down
8 changes: 8 additions & 0 deletions test/expected/extension_custom_scripts.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ set role extensions_role;
\echo

-- per-extension custom scripts are run
drop extension if exists citext;
NOTICE: extension "citext" does not exist, skipping
create extension autoinc;
drop extension citext;
drop extension autoinc;
\echo

-- per-extension custom scripts are run for extensions not in privileged_extensions
create extension fuzzystrmatch;
drop extension fuzzystrmatch;
select * from t2;
Expand Down
2 changes: 1 addition & 1 deletion test/init.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ wal_level=logical

supautils.reserved_roles='supabase_storage_admin, anon, reserved_but_not_yet_created, authenticator*'
supautils.reserved_memberships='pg_read_server_files,pg_write_server_files,pg_execute_server_program,role_with_reserved_membership'
supautils.privileged_extensions='autoinc, citext, hstore, sslinfo, insert_username, dict_xsyn, fuzzystrmatch, postgres_fdw, pageinspect'
supautils.privileged_extensions='autoinc, citext, hstore, sslinfo, insert_username, dict_xsyn, postgres_fdw, pageinspect'
supautils.constrained_extensions='{"adminpack": { "cpu": 64}, "cube": { "mem": "17 GB"}, "lo": { "disk": "100 GB"}, "amcheck": { "cpu": 2, "mem": "100 MB", "disk": "100 MB"}}'
supautils.privileged_role='privileged_role'
supautils.privileged_role_allowed_configs='session_replication_role, pgrst.*, other.nested.*'
Expand Down
2 changes: 2 additions & 0 deletions test/init.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh

# print notice when creating an extension
mkdir -p "$TMPDIR/extension-custom-scripts"
echo "do \$\$
Expand Down
2 changes: 1 addition & 1 deletion test/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ grant all on database postgres to privileged_role;

-- non-superuser extensions role
create role extensions_role login nosuperuser;
grant all on database postgres to extensions_role;
grant all on database contrib_regression, postgres to extensions_role;
alter default privileges for role postgres in schema public grant all on tables to extensions_role;

-- non-superuser that should be unaffected by extension logic when creating db objects
Expand Down
8 changes: 8 additions & 0 deletions test/sql/extension_custom_scripts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ set role extensions_role;
\echo

-- per-extension custom scripts are run
drop extension if exists citext;
create extension autoinc;

drop extension citext;
drop extension autoinc;
\echo

-- per-extension custom scripts are run for extensions not in privileged_extensions
create extension fuzzystrmatch;
drop extension fuzzystrmatch;
select * from t2;
Expand Down
Loading