RefLib

Reference library for AI

Back

postgresql_16:7.1.61.4 Examples

PostgreSQL 16 > Reference > SQL Commands > CREATE EVENT TRIGGER > Examples

Forbid the execution of any DDL (see postgresql_16:3.2) command: CREATE OR REPLACE FUNCTION abort_any_command() RETURNS event_trigger LANGUAGE plpgsql AS $$ BEGIN RAISE EXCEPTION 'command % is disabled', tg_tag; END; $$; CREATE EVENT TRIGGER abort_ddl ON ddl_command_start EXECUTE FUNCTION abort_any_command();

Back