Using Console
log_executor_stats
flag.on
, click on the X button to remove it.Using CLI
gcloud sql connect [INSTANCE_NAME] --user=postgres
Replace [INSTANCE_NAME] with the name of your PostgreSQL instance.
SHOW log_executor_stats;
ALTER SYSTEM SET log_executor_stats = off;
SELECT pg_reload_conf();
SHOW log_executor_stats;
The output should show “off”.
Using Python
google-auth
and google-cloud-secret-manager
packages to achieve this.
google-cloud-sql
package to get the list of all the PostgreSQL instances in the project.
log_executor_stats
flag is set to on
or not. You can use the psycopg2
package to connect to the instance and execute the following SQL query to get the value of the flag:
on
, you can execute the following SQL query to turn it off: