Skip to content

Commit

Permalink
Added pg_stat_statements fix (#20)
Browse files Browse the repository at this point in the history
Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto committed Oct 26, 2023
1 parent 2d7f3e7 commit 981242a
Show file tree
Hide file tree
Showing 29 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions role_scripts/10/primary/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/10/standby/ha_backup_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions role_scripts/10/standby/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/10/standby/warm_stanby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions role_scripts/11/primary/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/11/standby/ha_backup_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/11/standby/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/11/standby/warm_stanby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/12/primary/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/12/standby/ha_backup_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/12/standby/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/12/standby/warm_stanby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions role_scripts/13/primary/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/13/standby/ha_backup_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/13/standby/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/13/standby/warm_stanby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions role_scripts/14/primary/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions role_scripts/14/standby/ha_backup_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions role_scripts/14/standby/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/14/standby/warm_stanby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions role_scripts/15/primary/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions role_scripts/15/standby/ha_backup_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions role_scripts/15/standby/remote-replica.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions role_scripts/15/standby/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions role_scripts/15/standby/warm_stanby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/9/primary/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/9/standby/ha_backup_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/9/standby/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role_scripts/9/standby/warm_stanby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 981242a

Please sign in to comment.