Comments (10)
Had to do:
DROP FUNCTION pg_stat_statements_reset();
DROP FUNCTION pg_stat_statements() CASCADE;
NOTICE: drop cascades to view pg_stat_statements
CREATE EXTENSION pg_stat_statements;
pghero is happy.
from pghero.
CREATE EXTENSION pg_stat_statements shows me ERROR: permission denied to create "pg_catalog.pg_stat_statements". Current user is superuser. what should I do?
from pghero.
seems to be not installed?
<db>=# SELECT * FROM pg_available_extensions WHERE name = 'pg_stat_statements';
name | default_version | installed_version | comment
--------------------+-----------------+-------------------+------------------------------------------------------
-----
pg_stat_statements | 1.1 | | track execution statistics of all SQL statements exec
uted
(1 row)
but I use that to email slow queries daily.
results = PgStatStatement.select("*, round((total_time / calls)::numeric, 2) as s").
order("s DESC").all
from pghero.
Very odd. Does pg_stat_statements
appear in this query with installed true
?
SELECT * FROM pg_available_extension_versions;
Do you recall how pg_stat_statements
was originally installed?
from pghero.
No, it's not installed.
name | version | installed | superuser | relocatable | schema | requires |
comment
--------------------+---------+-----------+-----------+-------------+--------+----------+------------------------
-----------------------------------
pg_stat_statements | 1.1 | f | t | t | | | track execution statist
ics of all SQL statements executed
(1 row)
I didn't run create extension
, just add to shared_libraries following instructions:
http://www.postgresql.org/docs/9.2/static/pgstatstatements.html
The module must be loaded by adding pg_stat_statements to shared_preload_libraries in postgresql.conf, because it requires additional shared memory. This means that a server restart is needed to add or remove the module.
from pghero.
it seems something wrong with db. Tried with new db on my local (postgresql 9.3.5)
→ createdb zxc
→ psql zxc
zxc=# SELECT * FROM pg_stat_statements;
ERROR: relation "pg_stat_statements" does not exist
zxc=# CREATE extension pg_stat_statements;
CREATE EXTENSION
zxc=# SELECT * FROM pg_stat_statements;
userid | dbid | ........
from pghero.
You'd lose historic data, but one option is to drop functions and views as you hit errors with CREATE EXTENSION pg_stat_statements
.
DROP FUNCTION pg_stat_statements_reset;
-- DROP VIEW pg_stat_statements; etc
from pghero.
It seems a weird bug with particular DB. Will do cleanup as you advised. Thx
from pghero.
Thanks for following up with your solution! I'm sure others encountering this will find it useful.
from pghero.
https://github.com/ankane/pghero/blob/master/guides/Query-Stats.md
from pghero.
Related Issues (20)
- Error in SQL explain HOT 1
- Filter for user on queries tab
- [Idea] Show transaction duration on "Live Queries" page HOT 1
- Upgrade Alpine Linux image HOT 3
- [Idea] Allow sorting of tables on the Maintenance tab
- Issuing a new Release (e.g. v3.3.5) HOT 1
- Multi-architecture images for tags other than `latest` HOT 2
- pghero completed 500 internal error throwing plaintext password HOT 2
- GCP Cloud SQL System Stats not enable. HOT 1
- ArgumentError in `slow_queries` HOT 1
- Unable to show space graph on Azure Flexible Postgres Server if storage auto-growth is enabled HOT 1
- There are no graphs HOT 1
- Upgrading PGSQL Version HOT 3
- [Idea] Live queries parameters HOT 1
- Anonymize explain input
- Support for Debian12 HOT 2
- [Idea] Enable/Disable Option for "Kill" Button
- Unsolicited Email HOT 2
- `undefined method 'symbolize_keys'` when running on Rails' main branch HOT 2
- GCP stats not working anymore HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pghero.