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:
- Connect a
psqlclient to the cluster's primary instance, as described in Connect a psql client to an instance. - At the
psqlcommand prompt, connect to the database that has the extension enabled and drop the extension:\c DB_NAME DROP EXTENSION pgaudit;Replace
DB_NAMEwith the name of the database. - Repeat the previous two steps to connect to other databases and drop the extension in each one of them.