Skip to content

create-rule (GN002)#

Automatic fix is not available.

What it does#

Checks for creation of rules.

Why not?#

Rules are incredibly powerful, but they don't do what they look like they do. They look like they're some conditional logic, but they actually rewrite a query to modify it or add additional queries to it.

When should you?#

Never. While the rewriter is an implementation detail of VIEWs, there is no reason to pry up this cover plate directly.

Use instead:#

Don't use rules. If you think you want to, use a trigger instead.