Disable pgAudit

To disable pgAudit on an AlloyDB instance, set the value of the alloydb.enable_pgaudit flag to off. You can change the value of the alloydb.enable_pgaudit flag through the Google Cloud console or the gcloud command.

To disable the alloydb.enable_pgaudit flag, use the standard instructions as described in Configure an instance's database flags.

When you disable the alloydb.enable_pgaudit flag, audit logging stops immediately. However, it saves the applied pgAudit settings such as the pgaudit.log parameter settings.

Additionally, run the DROP EXTENSION command by using a compatible psql client to remove the extension state.

You disable an extension by reversing the procedure used to enable it.

gcloud

To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.

  1. Connect a psql client to the cluster's primary instance, as described in Connect a psql client to an instance.
  2. At the psql command prompt, connect to the database that has the extension enabled and drop the extension:
        \c DB_NAME
        DROP EXTENSION pgaudit;
        
  3. Repeat the previous two steps to connect to other databases and create the extension in each one of them.