Skip to content

False positive for pg_temp schema #692

@mplanchard

Description

@mplanchard

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

This was asked as a question here, but it is a bug, since it rejects valid sql.

Describe the bug

Each session has access to a temporary table schema, pg_temp_nnn, which is aliased to pg_temp. It is documented here.

We often use pg_temp in our migrations to create temporary functions or tables that we do not need after the migration completes.

postgrestools reports an error for any use of pg_temp:

✖ schema "pg_temp" does not exist

However, this is not an error, as code using pg_temp runs just fine.

To Reproduce

create table pg_temp.foo (id int);
select * from pg_temp.foo

Expected behavior

The above should not yield an error.

System information

  • OS: linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions