← all rules

require-schema-qualified

warning

Unqualified relation name

Why it's unsafe

An unqualified name in a DDL statement resolves through the session's search_path, which is environment-dependent — the same migration can hit a different object in a different environment. Covers the relations that CREATE / ALTER / RENAME / DROP / TRUNCATE / CREATE INDEX target (tables, indexes, views, materialized views, sequences, foreign tables).

Safe rewrite

Qualify the name with its schema (e.g. public.orders) so resolution does not depend on search_path.

Example

Try it in the playground →

Unsafe

ALTER TABLE orders ADD COLUMN note text;

Safe

ALTER TABLE public.orders ADD COLUMN note text;

Related