Skip to content

Commit f18d9a3

Browse files
committed
Disable triggers when running after-create.sql hook of postgres_fdw
1 parent da08e35 commit f18d9a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ansible/files/postgresql_extension_custom_scripts/postgres_fdw/after-create.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ begin
1010

1111
-- Need to be superuser to own FDWs, so we temporarily make postgres superuser.
1212
if not is_super then
13+
set session_replication_role = replica;
1314
alter role postgres superuser;
1415
end if;
1516

1617
alter foreign data wrapper postgres_fdw owner to postgres;
1718

1819
if not is_super then
1920
alter role postgres nosuperuser;
21+
reset session_replication_role;
2022
end if;
2123
end $$;

0 commit comments

Comments
 (0)