V
V
Victor Marquardt2017-10-09 19:19:05
PostgreSQL
Victor Marquardt, 2017-10-09 19:19:05

How to view existing event triggers (Event Trigger, postgresql)?

I can't find the answer in the postgresql docs. How to create / delete / enable / disable - found, but how to view the created ones - no? Can you see them at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2017-10-09
@Cempl

They are registered in the system view pg_event_trigger
https://www.postgresql.org/docs/9.6/static/catalog...
In psql there is a shortcut \dy that executes the following query:

SELECT evtname as "Name", evtevent as "Event", pg_catalog.pg_get_userbyid(e.evtowner) as "Owner",
 case evtenabled when 'O' then 'enabled'  when 'R' then 'replica'  when 'A' then 'always'  when 'D' then 'disabled' end as "Enabled",
 e.evtfoid::pg_catalog.regproc as "Procedure", pg_catalog.array_to_string(array(select x from pg_catalog.unnest(evttags) as t(x)), ', ') as "Tags"
FROM pg_catalog.pg_event_trigger e ORDER BY 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question