Skip to content

schema "pg_pgrst_no_exposed_schemas" does not exist

Last edited: 8/12/2026

PostgREST 日志显示错误:

🌐 PostgREST logs showing the error:

  • schema "pg_pgrst_no_exposed_schemas" does not exist

为什么会这样 #

🌐 Why this happens

  • 当 Supabase 项目上的数据 API 被禁用时,会看到这个错误。
  • 目前,当禁用数据 API 时,我们实际上并不会真正关闭 PostgREST。你会看到在暴露的模式中添加了一个名为 pg_pgrst_no_exposed_schemas 的模式。
  • 这不应该对项目产生不利影响,虽然可能会在你的日志中增加一些条目。
  • 我们知道这个问题,并且正在处理它。

解决方法 #

🌐 Workaround

要停止缺失模式的日志条目:

🌐 To stop the missing-schema log entries:

  1. 打开 SQL 编辑器。

  2. 运行以下语句:

    1
    -- Create a schema with nothing inside
    2
    create schema pgrst_no_exposed_schemas;
    3
    4
    -- Set the db-schemas configuration
    5
    alter role authenticator set pgrst.db_schemas = 'pgrst_no_exposed_schemas';
    6
    7
    -- Reload PostgREST's schema cache and configuration
    8
    notify pgrst;

PostgREST 现在会暴露一个空的 schema,这样就不会再出现缺失 schema 的错误了。

🌐 PostgREST now exposes an empty schema, which stops the missing-schema errors.

重新启用数据 API #

🌐 Re-enable the Data API

在你重新启用数据 API 之前:

🌐 Before you re-enable the data API:

  1. 打开 SQL 编辑器。

  2. 运行以下语句:

    1
    -- Reset the db-schemas configuration
    2
    alter role authenticator reset pgrst.db_schemas;
    3
    4
    -- Reload PostgREST's schema cache and configuration
    5
    notify pgrst;