I am trying to enable some Postgres extensions to specific user in AWS RDS Postgres instance.
1) I have tried through deployment using rails migration, didnt work.
class InstallPgTrgmContribPackage < ActiveRecord::Migration[5.1]
def change
enable_extension "fuzzystrmatch"
enable_extension "pg_trgm"
enable_extension "unaccent"
# execute "CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;"
# execute "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
# execute "CREATE EXTENSION IF NOT EXISTS unaccent;"
end
end
2) Also, tried through ssh-ing into postgres and create it from there.
psql -h blabla.us-east-1.rds.amazonaws.com -p 5432 -U prod -d prod
prod=> CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
returns: ERROR: permission denied to create extension "fuzzystrmatch"
HINT: Must be superuser to create this extension.
By default RDS instance role is test, and I am able to create extension in test user. I am trying to install in prod and dev users.
The rails application deployed through Elastic Beanstalk.
Question: How to add superuser privileges into new user role?

pg_trgmextension in dev and prod user roles, and it returnsMust be superuser to create this extension. - 7urkm3n