From e59e0dc25d2102269bcc6924bfb2756b43505f7e Mon Sep 17 00:00:00 2001 From: Peach Leach Date: Thu, 23 Apr 2026 16:31:02 -0400 Subject: [PATCH] added enable and disable trigger to alter table --- src/current/v26.2/alter-table.md | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/current/v26.2/alter-table.md b/src/current/v26.2/alter-table.md index 3001ee1834e..a09c30c8d27 100644 --- a/src/current/v26.2/alter-table.md +++ b/src/current/v26.2/alter-table.md @@ -51,9 +51,11 @@ Subcommand | Description | Can combine with other subcommands? [`ALTER PRIMARY KEY`](#alter-primary-key) | Change the [primary key]({% link {{ page.version.version }}/primary-key.md %}) of a table. | Yes [`CONFIGURE ZONE`](#configure-zone) | [Replication Controls]({% link {{ page.version.version }}/configure-replication-zones.md %}) for a table. | No [`DISABLE ROW LEVEL SECURITY`](#disable-row-level-security) | Disable [row-level security]({% link {{ page.version.version }}/row-level-security.md %}) for a table. | Yes +[`DISABLE TRIGGER`](#disable-trigger) | Disable a [trigger]({% link {{ page.version.version }}/triggers.md %}) for a table. | Yes [`DROP COLUMN`](#drop-column) | Remove columns from tables. | Yes [`DROP CONSTRAINT`](#drop-constraint) | Remove constraints from columns. | Yes [`ENABLE ROW LEVEL SECURITY`](#enable-row-level-security) | Enable [row-level security]({% link {{ page.version.version }}/row-level-security.md %}) for a table. | Yes +[`ENABLE TRIGGER`](#enable-trigger) | Enable a [trigger]({% link {{ page.version.version }}/triggers.md %}) for a table. | Yes [`EXPERIMENTAL_AUDIT`](#experimental_audit) | Enable per-table audit logs, for security purposes. | Yes [`FORCE / NO FORCE ROW LEVEL SECURITY`](#force-row-level-security) | Force the table owner to be subject to [row-level security]({% link {{ page.version.version }}/row-level-security.md %}) policies defined on a table. | Yes [`OWNER TO`](#owner-to) | Change the owner of the table. | No @@ -501,6 +503,18 @@ This statement disables [Row-level security]({% link {{ page.version.version }}/ For examples, refer to [Disable row-level security](#disable-row-level-security). +### `ENABLE TRIGGER` + +This statement enables a [trigger]({% link {{ page.version.version }}/triggers.md %}) associated with a table. When a trigger is enabled for a table, it activates if its triggering event occurs on the table. Use `ENABLE TRIGGER ALL` or `ENABLE TRIGGER USER` to enable all triggers associated with a table. + +For examples, refer to [Enable a trigger](#enable-a-trigger). + +### `DISABLE TRIGGER` + +This statement disables a [trigger]({% link {{ page.version.version }}/triggers.md %}) associated with a table. When a trigger is disabled for a table, it does not activate even if its triggering event occurs on the table. Use `DISABLE TRIGGER ALL` or `DISABLE TRIGGER USER` to disable all triggers associated with a table. + +For examples, refer to [Disable a trigger](#disable-a-trigger). + #### Required privileges The user must be a member of the [`admin`]({% link {{ page.version.version }}/security-reference/authorization.md %}#roles) or [owner]({% link {{ page.version.version }}/security-reference/authorization.md %}#object-ownership) roles. @@ -3401,6 +3415,48 @@ ALTER TABLE orders NO FORCE ROW LEVEL SECURITY; Users with the `BYPASSRLS` [role option]({% link {{ page.version.version }}/security-reference/authorization.md %}#role-options) can still bypass RLS even when `ALTER TABLE ... FORCE ROW LEVEL SECURITY` is enabled. {{site.data.alerts.end}} +### Enable a trigger + +To enable a [trigger]({% link {{ page.version.version }}/triggers.md %}) associated with a table, use the following statement: + +{% include_cached copy-clipboard.html %} +~~~ sql +ALTER TABLE ENABLE TRIGGER ; +~~~ + +To enable all triggers associated with a table, use either of the following statements: + +{% include_cached copy-clipboard.html %} +~~~ sql +ALTER TABLE ENABLE TRIGGER ALL; +~~~ + +{% include_cached copy-clipboard.html %} +~~~ sql +ALTER TABLE ENABLE TRIGGER USER; +~~~ + +### Disable a trigger + +To disable a [trigger]({% link {{ page.version.version }}/triggers.md %}) associated with a table, use the following statement: + +{% include_cached copy-clipboard.html %} +~~~ sql +ALTER TABLE DISABLE TRIGGER ; +~~~ + +To disable all triggers associated with a table, use either of the following statements: + +{% include_cached copy-clipboard.html %} +~~~ sql +ALTER TABLE DISABLE TRIGGER ALL; +~~~ + +{% include_cached copy-clipboard.html %} +~~~ sql +ALTER TABLE DISABLE TRIGGER USER; +~~~ + ## See also - [Multi-Region Capabilities Overview]({% link {{ page.version.version }}/multiregion-overview.md %})