+ begin
+ execute "CREATE EXTENSION IF NOT EXISTS pg_trgm"
+ rescue ActiveRecord::StatementInvalid => e
+ puts "Cannot create the pg_trgm extension."
+ if e.cause.is_a?(PG::InsufficientPrivilege)
+ puts "The user must have a SUPERUSER role."
+ elsif e.cause.is_a?(PG::UndefinedFile)
+ puts "The postgresql-contrib package is most likely not installed."
+ else
+ puts "Unknown Error."
+ end
+ puts "Please visit https://doc.arvados.org/admin/upgrading.html for instructions on how to run this migration."
+ throw e
+ end
+