-
-
Notifications
You must be signed in to change notification settings - Fork 238
Expand file tree
/
Copy pathpostgres_fdw.out
More file actions
32 lines (27 loc) · 1.09 KB
/
postgres_fdw.out
File metadata and controls
32 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
Test to verify supautils (v3.0.0+) allows non-superuser postgres role to use postgres_fdw.
This test ensures that the supautils extension properly handles FDW usage
for the privileged postgres role without requiring temporary superuser privileges.
This verifies the fix that eliminated the need for:
https://github.com/supabase/postgres/blob/a638c6fce0baf90b654e762eddcdac1bc8df01ee/ansible/files/postgresql_extension_custom_scripts/postgres_fdw/after-create.sql (removed)
*/
begin;
-- Create the extension within the test (matches production pattern)
create extension if not exists postgres_fdw with schema extensions;
-- Switch to the postgres role (non-superuser) to test supautils behavior
set role postgres;
-- postgres_fdw should be owned by the superuser
select fdwowner::regrole from pg_foreign_data_wrapper where fdwname = 'postgres_fdw';
fdwowner
----------------
supabase_admin
(1 row)
-- Verify that `postgres` can use the FDW despite not owning it
create server s
foreign data wrapper postgres_fdw
options (
host '127.0.0.1',
port '5432',
dbname 'postgres'
);
rollback;