Skip to content

missing-replace-in-trigger (GN030)#

Automatic fix is available.

What it does#

Checks for replace in trigger creation.

Why not?#

CREATE OR REPLACE TRIGGER simplifies the process of modifying existing functions, as you don't need to manually drop and recreate them.

If you drop and then recreate a trigger, the new trigger is not the same entity as the old; you will have to drop existing rules, views, triggers, etc. that refer to the old trigger. Use CREATE OR REPLACE TRIGGER to change a trigger definition without breaking objects that refer to the trigger. It also maintains data integrity and consistency.

When should you?#

If you don't need to modify an existing trigger.

Use instead:#

CREATE OR REPLACE TRIGGER.