How to enable pg_stat_statements in OpenShift

06.01.2016 01:53:24

pg_stat_statements is a great way how to track execution statistics of all executed SQL statements by your PostgreSQL server. Run these commands to enable them on OpenShift (replace APP_NAME with your application's name):

1. rhc set-env OPENSHIFT_POSTGRESQL_CONFIG="shared_preload_libraries = 'pg_stat_statements';pg_stat_statements.track = all" -a APP_NAME

2. rhc app restart APP_NAME

3. rhc ssh -a APP_NAME

4. psql

5. \i /usr/share/pgsql/contrib/pg_stat_statements.sql

6. select * from pg_stat_statements;

More information

© Jiri Pinkas | this project on GitHub | related: JavaVids | Maven Central Repository Search | Java školení

Top Java Blogs is a Java blog aggregator (with English-written blogs only) focused on Java SE, Java EE, Spring Framework and Hibernate.

Made better & faster using Java Profiler