Skip to content

Commit bf452e4

Browse files
authored
fix: replace alter routine with alter function|procedure (#1333)
1 parent 42c6d7e commit bf452e4

File tree

1 file changed

+4
-1
lines changed
  • ansible/files/admin_api_scripts/pg_upgrade_scripts

1 file changed

+4
-1
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,10 @@ begin
456456
foreach obj in array functions
457457
loop
458458
if obj->>'owner' = 'postgres' then
459-
execute(format('alter routine %s(%s) owner to postgres;', (obj->>'oid')::regproc, pg_get_function_identity_arguments((obj->>'oid')::regproc)));
459+
execute(format('alter %s %s(%s) owner to postgres;'
460+
, case when obj->>'kind' = 'p' then 'procedure' else 'function'
461+
, (obj->>'oid')::regproc
462+
, pg_get_function_identity_arguments((obj->>'oid')::regproc)));
460463
end if;
461464
for rec in
462465
select grantor, grantee, privilege_type, is_grantable

0 commit comments

Comments
 (0)