Created
July 10, 2017 21:29
-
-
Save camelloj/ad6e0799ec001f060b2d5f8f6b9b4869 to your computer and use it in GitHub Desktop.
how to enable pg_stat_statements on postgres93
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * Install official PostgreSQL contrib package | |
| $ yum install postgresql93-contrib | |
| * Create extension | |
| $ create extension pg_stat_statements; | |
| * Edit postgresql.conf | |
| $ vim /var/lib/pgsql/9.3/data/postgresql.conf | |
| ** add | |
| shared_preload_libraries = pg_stat_statements (required) | |
| track_activity_query_size = 2048 (increase maximum length before which queries are truncated) | |
| pg_stat_statements.track = ALL (track all statements, including those inside stored procedures) | |
| pg_stat_statements.max = 10000 | |
| * restart postgres | |
| $ systemctl restart postgresql-9.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment