File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
ansible/files/postgresql_extension_custom_scripts/pgmq Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ do $$
2+ declare
3+ extoid oid := (select oid from pg_extension where extname = ' pgmq' );
4+ r record;
5+ begin
6+ set local search_path = ' ' ;
7+ update pg_extension set extowner = ' postgres' ::regrole where extname = ' pgmq' ;
8+ for r in (select * from pg_depend where refobjid = extoid) loop
9+ if r .classid = ' pg_type' ::regclass then
10+ execute(format(' alter type %s owner to postgres;' , r .objid ::regtype));
11+ elsif r .classid = ' pg_proc' ::regclass then
12+ execute(format(' alter function %s(%s) owner to postgres;' , r .objid ::regproc, pg_get_function_identity_arguments(r .objid )));
13+ elsif r .classid = ' pg_class' ::regclass then
14+ execute(format(' alter table %s owner to postgres;' , r .objid ::regclass));
15+ else
16+ raise exception ' error on pgmq after-create script: unexpected object type %' , r .classid ;
17+ end if;
18+ end loop;
19+ end $$;
You can’t perform that action at this time.
0 commit comments