Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save camelloj/ad6e0799ec001f060b2d5f8f6b9b4869 to your computer and use it in GitHub Desktop.

Select an option

Save camelloj/ad6e0799ec001f060b2d5f8f6b9b4869 to your computer and use it in GitHub Desktop.
how to enable pg_stat_statements on postgres93
* 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