You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After moving my database to Azure Postgres Flexible Server I am not able to run bin/rake pghero:capture_query_stats.
When running, I get:
rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied for function pg_stat_statements_reset
CONTEXT: SQL function "pg_stat_statements_reset" statement 1
/usr/local/bundle/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `exec'
/usr/local/bundle/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `block (2 levels) in execute'
/usr/local/bundle/gems/activesupport-7.0.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/usr/local/bundle/gems/activesupport-7.0.4.3/lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'
/usr/local/bundle/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:47:in `block in execute'
/usr/local/bundle/gems/activesupport-7.0.4.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/local/bundle/gems/activesupport-7.0.4.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/local/bundle/gems/activesupport-7.0.4.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/local/bundle/gems/activesupport-7.0.4.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/local/bundle/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:765:in `block in log'
/usr/local/bundle/gems/activesupport-7.0.4.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/local/bundle/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:756:in `log'
/usr/local/bundle/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:46:in `execute'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero/methods/basic.rb:104:in `execute'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero/methods/query_stats.rb:94:in `reset_instance_query_stats'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero/methods/query_stats.rb:152:in `block in capture_query_stats'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero/methods/query_stats.rb:151:in `each'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero/methods/query_stats.rb:151:in `capture_query_stats'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero.rb:195:in `block in capture_query_stats'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero.rb:264:in `block in each_database'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero.rb:262:in `each'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero.rb:262:in `each_database'
/usr/local/bundle/gems/pghero-3.3.3/lib/pghero.rb:192:in `capture_query_stats'
/usr/local/bundle/gems/pghero-3.3.3/lib/tasks/pghero.rake:4:in `block (2 levels) in <top (required)>
Dropped and recreated the schema but I keep getting the same error.
Granted access to the user for the function but still the same.
When I am trying to run execute("SELECT pg_stat_statements_reset(#{quote(user_id.to_i)}, #{quote(database_id.to_i)}, #{quote(query_id.to_i)})") directly in psql like SELECT pg_stat_statements_reset(16384, 24680, 0); it runs without any errors
Context:
This database was running on GCP (pghero worked without any issues) and is now moved to Azure.
The text was updated successfully, but these errors were encountered:
After moving my database to Azure Postgres Flexible Server I am not able to run
bin/rake pghero:capture_query_stats
.When running, I get:
Dropped and recreated the schema but I keep getting the same error.
Granted access to the user for the function but still the same.
When I am trying to run
execute("SELECT pg_stat_statements_reset(#{quote(user_id.to_i)}, #{quote(database_id.to_i)}, #{quote(query_id.to_i)})")
directly inpsql
likeSELECT pg_stat_statements_reset(16384, 24680, 0);
it runs without any errorsContext:
This database was running on GCP (pghero worked without any issues) and is now moved to Azure.
The text was updated successfully, but these errors were encountered: