Skip to content

Commit

Permalink
fix: pgmq ownership (#1362)
Browse files Browse the repository at this point in the history
* fix: pgmq ownership

* tmp

* bump version for production release

---------

Co-authored-by: Oliver Rice <[email protected]>
  • Loading branch information
soedirgo and olirice authored Dec 9, 2024
1 parent 34cbe36 commit 8b3db2e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
do $$
declare
extoid oid := (select oid from pg_extension where extname = 'pgmq');
r record;
begin
set local search_path = '';
update pg_extension set extowner = 'postgres'::regrole where extname = 'pgmq';
for r in (select * from pg_depend where refobjid = extoid) loop
if r.classid = 'pg_type'::regclass then
execute(format('alter type %s owner to postgres;', r.objid::regtype));
elsif r.classid = 'pg_proc'::regclass then
execute(format('alter function %s(%s) owner to postgres;', r.objid::regproc, pg_get_function_identity_arguments(r.objid)));
elsif r.classid = 'pg_class'::regclass then
execute(format('alter table %s owner to postgres;', r.objid::regclass));
else
raise exception 'error on pgmq after-create script: unexpected object type %', r.classid;
end if;
end loop;
end $$;
2 changes: 1 addition & 1 deletion common-nix.vars.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
postgres-version = "15.6.1.145"
postgres-version = "15.6.1.146"

0 comments on commit 8b3db2e

Please sign in to comment.