Stay organized with collectionsSave and categorize content based on your preferences.
To disable pgAudit on an AlloyDB instance, set the value of thealloydb.enable_pgauditflag tooff. You can change the
value of thealloydb.enable_pgauditflag through the Google Cloud console
or the gcloud command.
When you disable thealloydb.enable_pgauditflag, audit logging stops
immediately. However, it saves the applied pgAudit settings such as the pgaudit.log
parameter settings.
Additionally, run theDROP EXTENSIONcommand by using a compatiblepsqlclient to remove the extension state.
You disable an extension by reversing the procedure used to enable it.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eDisabling pgAudit on an AlloyDB instance involves setting the \u003ccode\u003ealloydb.enable_pgaudit\u003c/code\u003e flag to \u003ccode\u003eoff\u003c/code\u003e through the Google Cloud console or the gcloud command.\u003c/p\u003e\n"],["\u003cp\u003eAudit logging ceases immediately upon disabling the \u003ccode\u003ealloydb.enable_pgaudit\u003c/code\u003e flag, while retaining the applied pgAudit settings.\u003c/p\u003e\n"],["\u003cp\u003eUpdating the \u003ccode\u003ealloydb.enable_pgaudit\u003c/code\u003e flag results in an automatic restart of the instance.\u003c/p\u003e\n"],["\u003cp\u003eRemoving the pgAudit extension state requires executing the \u003ccode\u003eDROP EXTENSION\u003c/code\u003e command via a compatible \u003ccode\u003epsql\u003c/code\u003e client.\u003c/p\u003e\n"],["\u003cp\u003eThe procedure to disable an extension is essentially the reverse of the steps taken to enable it.\u003c/p\u003e\n"]]],[],null,["# Disable pgAudit\n\nTo disable pgAudit on an AlloyDB instance, set the value of the\n`alloydb.enable_pgaudit` flag to `off`. You can change the\nvalue of the `alloydb.enable_pgaudit` flag through the Google Cloud console\nor the gcloud command.\n\nTo disable the `alloydb.enable_pgaudit` flag, use the standard\ninstructions as described in\n[Configure an instance's database flags](/alloydb/docs/instance-configure-database-flags).\n\nWhen you disable the `alloydb.enable_pgaudit` flag, audit logging stops\nimmediately. However, it saves the applied pgAudit settings such as the pgaudit.log\nparameter settings.\n| **Note:** The instance automatically restarts when you update the `alloydb.enable_pgaudit` flag.\n\nAdditionally, run the `DROP EXTENSION` command by using a compatible\n`psql` client to remove the extension state.\n\nYou disable an extension by reversing the procedure used to enable it. \n\n### gcloud\n\nTo use the gcloud CLI, you can\n[install and initialize](/sdk/docs/install) the Google Cloud CLI, or you\ncan use [Cloud Shell](/shell/docs/using-cloud-shell).\n\n1. Connect a `psql` client to the cluster's primary instance, as described in [Connect a psql client to\n an instance](/alloydb/docs/connect-psql).\n2. At the `psql` command prompt, connect to the database that has the extension enabled and drop the extension: \n\n ```\n \\c DB_NAME\n DROP EXTENSION pgaudit;\n \n ```\n3. Repeat the previous two steps to connect to other databases and create the extension in each one of them."]]