File: event_triggers.sql

package info (click to toggle)
postgresql-pllua 1%3A2.0.10-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,316 kB
  • sloc: ansic: 14,369; sql: 2,181; makefile: 163; sh: 59; javascript: 38
file content (26 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--

\set VERBOSITY terse
\set QUIET 0

-- Test event triggers.

create function evtrig() returns event_trigger language pllua as $$
  print(trigger.event, trigger.tag)
$$;

create event trigger et1 on ddl_command_start execute procedure evtrig();
create event trigger et2 on ddl_command_end execute procedure evtrig();
create event trigger et3 on sql_drop execute procedure evtrig();
create event trigger et4 on table_rewrite execute procedure evtrig();

create table evt1 (a text);
alter table evt1 alter column a type integer using null;
drop table evt1;

drop event trigger et1;
drop event trigger et2;
drop event trigger et3;
drop event trigger et4;

--end