PostgreSQL database instance ‘log_checkpoints’ database flag should be set to ‘on’


The PostgreSQL database instance flag ‘log_checkpoints’ causes checkpoints and restart points to be logged which in turn generates query and error logs. Query and error logs can be used to identify, troubleshoot, and repair configuration errors and suboptimal performance.

Remediation Steps

Google Cloud Console

  • Navigate to Cloud SQL instances.

  • Click on the Cloud SQL PostgreSQL database instance name to go to the Overview page.

  • Click EDIT and scroll down to the Flags section.

  • Select ADD FLAG, choose the log_checkpoints flag, and set the value to on.

  • Click DONE.

gcloud CLI

  • Set the log_checkpoints database flag to on for each Cloud SQL PostgreSQL database instance:

    • gcloud sql instances patch INSTANCE_NAME --database-flags log_checkpoints=on