File tree 1 file changed +11
-2
lines changed
engine/internal/provision/databases/postgres
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -163,21 +163,30 @@ begin
163
163
end loop;
164
164
end loop;
165
165
166
- -- Functions,
166
+ -- Functions and Procedures ,
167
167
for r in
168
168
select
169
+ p.prokind,
169
170
p.proname,
170
171
n.nspname,
171
172
pg_catalog.pg_get_function_identity_arguments(p.oid) as args
172
173
from pg_catalog.pg_namespace as n
173
174
join pg_catalog.pg_proc as p on p.pronamespace = n.oid
174
175
where not n.nspname in ('pg_catalog', 'information_schema')
175
176
and p.proname not ilike 'dblink%' -- We do not want dblink to be involved (exclusion)
177
+ and p.prokind in ('f', 'p', 'a', 'w')
176
178
loop
177
179
raise debug 'Changing ownership of function %.%(%) to %',
178
180
r.nspname, r.proname, r.args, new_owner;
179
181
execute format(
180
- 'alter function %I.%I(%s) owner to %I', -- todo: check support CamelStyle r.args
182
+ 'alter %s %I.%I(%s) owner to %I', -- todo: check support CamelStyle r.args,
183
+ case r.prokind
184
+ when 'f' then 'function'
185
+ when 'w' then 'function'
186
+ when 'p' then 'procedure'
187
+ when 'a' then 'aggregate'
188
+ else 'unknown'
189
+ end,
181
190
r.nspname,
182
191
r.proname,
183
192
r.args,
You can’t perform that action at this time.
0 commit comments