Skip to content

list_tables returns truncated check expressions for NOT VALID and NO INHERIT constraints #516

Closed

Description

@irisfield

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.

Describe the bug

list_tables with verbose: true returns a cut-off check expression when the column's CHECK constraint was created with NOT VALID or NO INHERIT. The returned text is not valid SQL, for example a > 0) NOT VALI instead of a > 0. Constraints without either option are returned correctly.

To Reproduce

  1. Run the following SQL:

    create table t (a int, b int, c int);
    alter table t add constraint a_pos check (a > 0) not valid;
    alter table t add constraint b_pos check (b > 0) no inherit;
    alter table t add constraint c_pos check (c > 0);
  2. Call list_tables with { "schemas": ["public"], "verbose": true }.

  3. The check field of each column in t is:

    column check
    a a > 0) NOT VALI
    b b > 0) NO INHERI
    c c > 0

Expected behavior

check contains only the constraint expression, the same way it does for c:

column check
a a > 0
b b > 0
c c > 0

System information

  • OS: Ubuntu (WSL2)
  • Browser: N/A
  • Version of @supabase/mcp-server-supabase: 0.15.0
  • Version of Node.js: 24.15.0
  • Database: hosted Supabase project, Postgres 17.11

Additional context

Related to supabase/postgres-meta#1143.

Activity

  1. added a commit that references this issue on Nov 11, 2026
    c54bb40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions