Using Console
Using CLI
gcloud sql instances list
gcloud sql instances describe [INSTANCE_NAME] --format="value(settings.postgresql.log_planner_stats)"
Replace [INSTANCE_NAME] with the name of your instance.
gcloud sql instances patch [INSTANCE_NAME] --database-flags log_planner_stats=off
Replace [INSTANCE_NAME] with the name of your instance.
gcloud sql instances describe [INSTANCE_NAME] --format="value(settings.postgresql.log_planner_stats)"
Replace [INSTANCE_NAME] with the name of your instance.
Using Python
log_planner_stats
flag:log_planner_stats
is on
, run the following query to turn it off:log_planner_stats
flag is now set to off
by running the query in Step 4 again.By following the above steps, you can remediate the “PostgreSQL Log Planner Stats Flag Should Be Off” misconfiguration for GCP using Python.