Based on documentation and several different examples on web I created this code for event triggers for PG 11. Maybe it can be useful for someone else too: — auditing table — CREATE TABLE IF NOT EXISTS public.ddl_history (ddl_date TIMESTAMP, ddl_tag TEXT,...
Because I found with surprise that DataGrip shows irregular version of trigger function’s source code and pgAdmin 4 somehow refuses to show it at all (claiming internal server error) I had to find some other way how to access it. Solution is described here...
show parent tables with trigger names: select inhparent, inhparent::regclass, count(*) as _count, (select string_agg(tgname,',') from pg_trigger t where t.tgrelid=i.inhparent ) as triggers from pg_inherits i group by 1 order by 1; show tables with user created...
Well in versions 9.3 and 9.4 event triggers are something like “very good start”. You can use them quite well but it is not exactly 100% comfortable. How to use them: Create function which returns “event_trigger”. Function will end with just...
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More Privacy & Cookies Policy