Skip to main content
The DROP TRIGGER drops a .

Required privileges

To drop a trigger, the user must be the owner of the table on which the trigger is defined.

Synopsis

drop_trigger syntax diagram

Parameters

ParameterDescription
trigger_nameThe name of the trigger to drop.
table_nameThe name of the table associated with the trigger.

Examples

Setup

To follow along, run to start a temporary, in-memory cluster with the sample dataset preloaded:
$ cockroach demo

Drop a trigger

Create a sample trigger function:
CREATE FUNCTION update_timestamp()
RETURNS TRIGGER AS $$
BEGIN
  RAISE NOTICE 'Current timestamp: %', now();
  RETURN NEW;
END;
$$ LANGUAGE PLpgSQL;
Create a sample trigger:
CREATE TRIGGER log_update_timestamp
AFTER UPDATE ON users
FOR EACH ROW
EXECUTE FUNCTION update_timestamp();
Drop the trigger:
DROP TRIGGER log_update_timestamp ON users;

Known limitations

with CASCADE is not supported.

See also