influitive / apartment

Database multi-tenancy for Rack (and Rails) applications
2.67k stars 463 forks source link

PG::UndefinedFunction: ERROR: function pg_stat_statements_reset() does not exist #578

Closed shivabhusal closed 5 years ago

shivabhusal commented 5 years ago

Error

 > Apartment::Tenant.create 'new1'
---------------------------
   (4.3ms)  CREATE SCHEMA "new1"
   (4.3ms)  CREATE SCHEMA "new1"
  SQL (6.8ms)  CREATE EXTENSION IF NOT EXISTS "plpgsql"
  SQL (6.8ms)  CREATE EXTENSION IF NOT EXISTS "plpgsql"
  SQL (4.1ms)  CREATE EXTENSION IF NOT EXISTS "pg_stat_statements"
  SQL (4.1ms)  CREATE EXTENSION IF NOT EXISTS "pg_stat_statements"
PG::UndefinedFunction: ERROR:  function pg_stat_statements_reset() does not exist
: CREATE EXTENSION IF NOT EXISTS "pg_stat_statements"
PG::UndefinedFunction: ERROR:  function pg_stat_statements_reset() does not exist
: CREATE EXTENSION IF NOT EXISTS "pg_stat_statements"
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR:  function pg_stat_statements_reset() does not exist
: CREATE EXTENSION IF NOT EXISTS "pg_stat_statements"
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:596:in `async_exec'
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:596:in `block in exec_no_cache'
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:596:in `exec_no_cache'
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:588:in `execute_and_clear'
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in `exec_query'
    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/rails-c0e1e4a069b3/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:342:in `enable_extension'
    from /app/vendor/bundle/ruby/

Expected behavior

Should have created the schema and have done migrations.

Actual behavior

this error is not letting me do anything

System configuration

bipashant commented 5 years ago

@shivabhusal https://stackoverflow.com/questions/28452481/heroku-apartment-pgerror-error-function-pg-stat-statements-reset-does-no

mikecmpbll commented 5 years ago

i'll assume a heroku issue unless confirmed otherwise.