Skip to content

Commit

Permalink
Refs #11098 - Update evr extension ownership after postgresql upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed Aug 6, 2024
1 parent de26c75 commit 13d9cc2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hooks/boot/06-postgresql-upgrade-extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def postgresql_upgrade(new_version)

execute_as!('postgres', 'vacuumdb --all --analyze-in-stages', false, true)

if new_version.to_i == 13
logger.notice("Updating ownership of the evr extension if upgrading to postgres version 13")
execute_as!('postgres', "psql -d foreman -c \"UPDATE pg_extension SET extowner = (SELECT oid FROM pg_authid WHERE rolname = 'foreman') WHERE extname = 'evr';\"", false, true)
end

logger.notice("Upgrade to PostgreSQL #{new_version} completed")
end

Expand Down

0 comments on commit 13d9cc2

Please sign in to comment.