Skip to main content
The SHOW TRIGGERS lists the defined on a table.

Required privileges

The user must have any on the target table.

Synopsis

show_triggers syntax diagram

Parameters

ParameterDescription
table_nameThe name of the table for which to list triggers.

Response

FieldDescription
trigger_nameThe name of the trigger.
enabledWhether the trigger is enabled.

Example

Create a sample table and trigger:
CREATE TABLE users (id INT PRIMARY KEY, name STRING);
CREATE FUNCTION update_timestamp()
RETURNS TRIGGER AS $$
BEGIN
  RAISE NOTICE 'Current timestamp: %', now();
  RETURN NEW;
END;
$$ LANGUAGE PLpgSQL;
CREATE TRIGGER log_update_timestamp
AFTER UPDATE ON users
FOR EACH ROW
EXECUTE FUNCTION update_timestamp();
List the triggers on the table:
SHOW TRIGGERS FROM users;
      trigger_name     | enabled
-----------------------+----------
  log_update_timestamp |    t
(1 row)

See also