Skip to content

unknownSchema

Group typecheck · Recommended · Needs a database connection · Since 0.27.0
Diagnostic lint/unknownSchema · Postgres error 3F000

Description

A schema does not exist.

pg_catalog and pg_temp always exist. Schemas created earlier in the same file are known.

Postgres raises 3F000 invalid_schema_name for these statements.

Examples

Invalid

select * from missing_schema.users;
code-block.sql:1:15 lint/unknownSchema ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × Schema missing_schema does not exist.

  > 1 │ select * from missing_schema.users;
      │               ^^^^^^^^^^^^^^^^^^^^
    2 │ 

Valid

create schema app;
create table app.users (id int8);
select * from app.users;

How to configure

{
  "linter": {
    "rules": {
      "unknownSchema": "error"
    }
  }
}

How to suppress

Suppress this diagnostic with a comment:

-- pgls-ignore unknownSchema