Skip to content

Commit 8b3db2e

Browse files
soedirgoolirice
andauthored
fix: pgmq ownership (#1362)
* fix: pgmq ownership * tmp * bump version for production release --------- Co-authored-by: Oliver Rice <[email protected]>
1 parent 34cbe36 commit 8b3db2e

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 $$;

common-nix.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.6.1.145"
1+
postgres-version = "15.6.1.146"

0 commit comments

Comments
 (0)