Disable pgAudit

To disable pgAudit on an AlloyDB for PostgreSQL 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 Google Cloud CLI.

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 after the instance restarts. However, AlloyDB 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:

  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;
        

    Replace DB_NAME with the name of the database.

  3. Repeat the previous two steps to connect to other databases and drop the extension in each one of them.