Skip to content

SQL Function: "missing FROM-clause" false positive when argument is row type #705

Description

@tbrugere-nrjx

Bug report

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

Describe the bug

postgres-language-server raises a false positive missing FROM-clause entry for table "row_arg" (pg typecheck) when accessing a parameter

  • in an SQL function
  • whose type is a composite type defined as a row of an existing table (see relevant section in doc )

To Reproduce

Here is a MRE:

CREATE TABLE public.tbl (
    id SERIAL PRIMARY KEY,
    name TEXT
  );

CREATE OR REPLACE FUNCTION public.get_tbl_name(row_arg public.tbl)
  RETURNS TEXT
  LANGUAGE sql
  STABLE
  AS $$
    SELECT row_arg.name;
  $$;

postgresql-language-server raises missing FROM-clause entry for table "row_arg" (pg typecheck)

Expected behavior

There should be no error: this works at runtime because the argument is resolved.

System information

  • OS: macOS 26.1

Additional context

This is similar to #353 , but I don’t think this is the same error, I think this case is specific to composite / row types. Solution might be to complete #366 to be able to mock those too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions