Heroku + Apartment PG::Error: ERROR: function pg_stat_statements_reset() does not exist
问题 I use Apartment gem in Rails 4 to support multi-tenancy in Postgres 9.3.3 on Heroku. An error is occurred when Apartment gem creates a new tenant. Deep investigation showed that a schema was created, but no tables inside. Heroku logs showed an error: PG::Error: ERROR: function pg_stat_statements_reset() does not exist 回答1: When a new schema is created Postgres is trying to reset stats by executing the function pg_stat_statements_reset() By default, this function can only be executed by