Skip to content

missing-replace-in-function (GN007)#

Automatic fix is available.

What it does#

Checks for replace in function creation.

Why not?#

CREATE OR REPLACE FUNCTION 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 function, the new function is not the same entity as the old; you will have to drop existing rules, views, triggers, etc. that refer to the old function. Use CREATE OR REPLACE FUNCTION to change a function definition without breaking objects that refer to the function. It also maintains data integrity and consistency.

When should you?#

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

Use instead:#

CREATE OR REPLACE FUNCTION.