Skip to content

missing-replace-in-view (GN029)#

Automatic fix is available.

What it does#

Checks for replace in view creation.

Why not?#

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

When should you?#

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

Use instead:#

CREATE OR REPLACE VIEW.