When creating a new schema, Postgres tries to reset statistics by executing the pg_stat_statements_reset () function
By default, this function can only be performed by superusers (from the original document) .
Heroku does not give you superuser privileges. Therefore, you need to disable the pg_stat_statements extension.
Solution 1 - Quick fix directly in DB
Executing an SQL statement in a public schema
DROP EXTENSION pg_stat_statements;
Solution 2 - Using Migration
1) Check the db / schema.rb file. Most likely it contains a string
enable_extension "pg_stat_statements"
2) Create a migration file
rails g migration DropExtensionPgStatStatements
3) define the self.up method
def self.up disable_extension "pg_stat_statements" end
4) apply migration
rake db:migrate
5) Now the db / schema.rb file should not contain this line
6) Commit the changes (schemas and migration files) and deploy them to Heroku
rake deploy:production:migrations
Regarding the rake task, see deploy.rake
source share