diff --git a/role_scripts/10/primary/start.sh b/role_scripts/10/primary/start.sh index c74d42e..48d337d 100755 --- a/role_scripts/10/primary/start.sh +++ b/role_scripts/10/primary/start.sh @@ -25,6 +25,7 @@ echo "wal_keep_segments = 1024" >>/tmp/postgresql.conf echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [[ "${SSL:-0}" == "ON" ]]; then echo "ssl =on" >>/tmp/postgresql.conf diff --git a/role_scripts/10/standby/ha_backup_job.sh b/role_scripts/10/standby/ha_backup_job.sh index 6747c74..8b09690 100755 --- a/role_scripts/10/standby/ha_backup_job.sh +++ b/role_scripts/10/standby/ha_backup_job.sh @@ -78,6 +78,7 @@ echo "wal_level = replica" >>/tmp/postgresql.conf echo "shared_buffers = $SHARED_BUFFERS" >>/tmp/postgresql.conf echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must be less than max_connections minus superuser_reserved_connections. ref: https://www.postgresql.org/docs/11/runtime-config-replication.html#GUC-MAX-WAL-SENDERS echo "wal_keep_segments = 1024" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf echo "wal_log_hints = on" >>/tmp/postgresql.conf diff --git a/role_scripts/10/standby/run.sh b/role_scripts/10/standby/run.sh index 267d7e4..b24c801 100755 --- a/role_scripts/10/standby/run.sh +++ b/role_scripts/10/standby/run.sh @@ -97,6 +97,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf diff --git a/role_scripts/10/standby/warm_stanby.sh b/role_scripts/10/standby/warm_stanby.sh index 6329179..d6fff1f 100755 --- a/role_scripts/10/standby/warm_stanby.sh +++ b/role_scripts/10/standby/warm_stanby.sh @@ -28,6 +28,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf echo "hot_standby = off" >>/tmp/postgresql.conf diff --git a/role_scripts/11/primary/start.sh b/role_scripts/11/primary/start.sh index 576527e..6c73cfb 100755 --- a/role_scripts/11/primary/start.sh +++ b/role_scripts/11/primary/start.sh @@ -25,6 +25,7 @@ echo "wal_keep_segments = 1024" >>/tmp/postgresql.conf echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [[ "${SSL:-0}" == "ON" ]]; then echo "ssl =on" >>/tmp/postgresql.conf diff --git a/role_scripts/11/standby/ha_backup_job.sh b/role_scripts/11/standby/ha_backup_job.sh index 73e5f36..f2b0f71 100755 --- a/role_scripts/11/standby/ha_backup_job.sh +++ b/role_scripts/11/standby/ha_backup_job.sh @@ -83,6 +83,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf diff --git a/role_scripts/11/standby/run.sh b/role_scripts/11/standby/run.sh index c11c03c..1ef2295 100755 --- a/role_scripts/11/standby/run.sh +++ b/role_scripts/11/standby/run.sh @@ -97,6 +97,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf diff --git a/role_scripts/11/standby/warm_stanby.sh b/role_scripts/11/standby/warm_stanby.sh index a2534bd..4c890b9 100755 --- a/role_scripts/11/standby/warm_stanby.sh +++ b/role_scripts/11/standby/warm_stanby.sh @@ -30,6 +30,7 @@ echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf echo "hot_standby = off" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [[ "$STREAMING" == "synchronous" ]]; then # setup synchronous streaming replication diff --git a/role_scripts/12/primary/start.sh b/role_scripts/12/primary/start.sh index 2a9a0ae..8aaaa48 100755 --- a/role_scripts/12/primary/start.sh +++ b/role_scripts/12/primary/start.sh @@ -27,6 +27,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf # we are not doing any archiving by default but it's better to have this config in our postgresql.conf file in case of customization. echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [[ "${SSL:-0}" == "ON" ]]; then echo "ssl =on" >>/tmp/postgresql.conf diff --git a/role_scripts/12/standby/ha_backup_job.sh b/role_scripts/12/standby/ha_backup_job.sh index 20ce1c5..ef0fe8c 100755 --- a/role_scripts/12/standby/ha_backup_job.sh +++ b/role_scripts/12/standby/ha_backup_job.sh @@ -79,6 +79,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf # we are not doing any archiving by default but it's better to have this config in our postgresql.conf file in case of customization. echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf diff --git a/role_scripts/12/standby/run.sh b/role_scripts/12/standby/run.sh index efaf6c2..fa54385 100755 --- a/role_scripts/12/standby/run.sh +++ b/role_scripts/12/standby/run.sh @@ -93,6 +93,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf # we are not doing any archiving by default but it's better to have this config in our postgresql.conf file in case of customization. echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf diff --git a/role_scripts/12/standby/warm_stanby.sh b/role_scripts/12/standby/warm_stanby.sh index 5ee068f..ba96c4d 100755 --- a/role_scripts/12/standby/warm_stanby.sh +++ b/role_scripts/12/standby/warm_stanby.sh @@ -27,6 +27,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf # we are not doing any archiving by default but it's better to have this config in our postgresql.conf file in case of customization. echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf echo "hot_standby = off" >>/tmp/postgresql.conf diff --git a/role_scripts/13/primary/start.sh b/role_scripts/13/primary/start.sh index beaff94..3ec6ac3 100755 --- a/role_scripts/13/primary/start.sh +++ b/role_scripts/13/primary/start.sh @@ -27,6 +27,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf # we are not doing any archiving by default but it's better to have this config in our postgresql.conf file in case of customization. echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [[ "${SSL:-0}" == "ON" ]]; then echo "ssl =on" >>/tmp/postgresql.conf diff --git a/role_scripts/13/standby/ha_backup_job.sh b/role_scripts/13/standby/ha_backup_job.sh index 6569fc5..f7e5e31 100755 --- a/role_scripts/13/standby/ha_backup_job.sh +++ b/role_scripts/13/standby/ha_backup_job.sh @@ -79,6 +79,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf # we are not doing any archiving by default but it's better to have this config in our postgresql.conf file in case of customization. echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf diff --git a/role_scripts/13/standby/run.sh b/role_scripts/13/standby/run.sh index aff067a..558f415 100755 --- a/role_scripts/13/standby/run.sh +++ b/role_scripts/13/standby/run.sh @@ -93,6 +93,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf # we are not doing any archiving by default but it's better to have this config in our postgresql.conf file in case of customization. echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf diff --git a/role_scripts/13/standby/warm_stanby.sh b/role_scripts/13/standby/warm_stanby.sh index d1f1d22..e7a02ca 100755 --- a/role_scripts/13/standby/warm_stanby.sh +++ b/role_scripts/13/standby/warm_stanby.sh @@ -29,6 +29,7 @@ echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf echo "hot_standby = off" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [[ "$STREAMING" == "synchronous" ]]; then # setup synchronous streaming replication diff --git a/role_scripts/14/primary/start.sh b/role_scripts/14/primary/start.sh index c23da10..bf89d57 100755 --- a/role_scripts/14/primary/start.sh +++ b/role_scripts/14/primary/start.sh @@ -28,6 +28,9 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf + + if [[ "${SSL:-0}" == "ON" ]]; then echo "ssl =on" >>/tmp/postgresql.conf echo "ssl_cert_file ='/tls/certs/server/server.crt'" >>/tmp/postgresql.conf diff --git a/role_scripts/14/standby/ha_backup_job.sh b/role_scripts/14/standby/ha_backup_job.sh index f35be95..6ca5d3e 100755 --- a/role_scripts/14/standby/ha_backup_job.sh +++ b/role_scripts/14/standby/ha_backup_job.sh @@ -80,6 +80,8 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf + if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf fi diff --git a/role_scripts/14/standby/run.sh b/role_scripts/14/standby/run.sh index 89d91e6..14eef43 100755 --- a/role_scripts/14/standby/run.sh +++ b/role_scripts/14/standby/run.sh @@ -94,6 +94,8 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf + if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf fi diff --git a/role_scripts/14/standby/warm_stanby.sh b/role_scripts/14/standby/warm_stanby.sh index 4dac484..c1c2161 100755 --- a/role_scripts/14/standby/warm_stanby.sh +++ b/role_scripts/14/standby/warm_stanby.sh @@ -29,6 +29,7 @@ echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf echo "hot_standby = off" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [[ "$STREAMING" == "synchronous" ]]; then # setup synchronous streaming replication diff --git a/role_scripts/15/primary/start.sh b/role_scripts/15/primary/start.sh index 452a608..053f640 100755 --- a/role_scripts/15/primary/start.sh +++ b/role_scripts/15/primary/start.sh @@ -28,6 +28,8 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf + if [[ "${SSL:-0}" == "ON" ]]; then echo "ssl =on" >>/tmp/postgresql.conf echo "ssl_cert_file ='/tls/certs/server/server.crt'" >>/tmp/postgresql.conf diff --git a/role_scripts/15/standby/ha_backup_job.sh b/role_scripts/15/standby/ha_backup_job.sh index 1dbe09e..49c4aaf 100755 --- a/role_scripts/15/standby/ha_backup_job.sh +++ b/role_scripts/15/standby/ha_backup_job.sh @@ -82,6 +82,8 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf + if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf fi diff --git a/role_scripts/15/standby/remote-replica.sh b/role_scripts/15/standby/remote-replica.sh index 8ae6568..6540bbc 100755 --- a/role_scripts/15/standby/remote-replica.sh +++ b/role_scripts/15/standby/remote-replica.sh @@ -71,6 +71,8 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf + if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf fi diff --git a/role_scripts/15/standby/run.sh b/role_scripts/15/standby/run.sh index 7c376a9..5d522da 100755 --- a/role_scripts/15/standby/run.sh +++ b/role_scripts/15/standby/run.sh @@ -94,6 +94,8 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf + if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf fi diff --git a/role_scripts/15/standby/warm_stanby.sh b/role_scripts/15/standby/warm_stanby.sh index 2acb70d..125f253 100755 --- a/role_scripts/15/standby/warm_stanby.sh +++ b/role_scripts/15/standby/warm_stanby.sh @@ -30,6 +30,8 @@ echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf echo "hot_standby = off" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf + if [[ "$STREAMING" == "synchronous" ]]; then # setup synchronous streaming replication echo "synchronous_commit = remote_write" >>/tmp/postgresql.conf diff --git a/role_scripts/9/primary/start.sh b/role_scripts/9/primary/start.sh index 54eff82..e3197c0 100755 --- a/role_scripts/9/primary/start.sh +++ b/role_scripts/9/primary/start.sh @@ -25,6 +25,7 @@ echo "wal_keep_segments = 1024" >>/tmp/postgresql.conf echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [[ "${SSL:-0}" == "ON" ]]; then echo "ssl = on" >>/tmp/postgresql.conf diff --git a/role_scripts/9/standby/ha_backup_job.sh b/role_scripts/9/standby/ha_backup_job.sh index d4a66fc..c8c6530 100755 --- a/role_scripts/9/standby/ha_backup_job.sh +++ b/role_scripts/9/standby/ha_backup_job.sh @@ -80,6 +80,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must echo "wal_keep_segments = 1024" >>/tmp/postgresql.conf echo "wal_log_hints = on" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf diff --git a/role_scripts/9/standby/run.sh b/role_scripts/9/standby/run.sh index 1adea80..effaf7c 100755 --- a/role_scripts/9/standby/run.sh +++ b/role_scripts/9/standby/run.sh @@ -97,6 +97,7 @@ echo "wal_log_hints = on" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf if [ "$STANDBY" == "hot" ]; then echo "hot_standby = on" >>/tmp/postgresql.conf diff --git a/role_scripts/9/standby/warm_stanby.sh b/role_scripts/9/standby/warm_stanby.sh index 3ba655c..b4387da 100755 --- a/role_scripts/9/standby/warm_stanby.sh +++ b/role_scripts/9/standby/warm_stanby.sh @@ -25,6 +25,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must echo "wal_keep_segments = 1024" >>/tmp/postgresql.conf echo "wal_log_hints = on" >>/tmp/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf echo "archive_mode = always" >>/tmp/postgresql.conf echo "archive_command = '/bin/true'" >>/tmp/postgresql.conf