Skip to content

FF Tables: duplicate-table check is name-only and matches on exactly one row #8637

Description

@andypalmi

Found while adding the create-database-table MCP tool (#8633).

The existence check filters by table name only and requires === 1, while the create runs unqualified (default schema). Tables sharing a name across schemas break the check.

Steps to reproduce

  1. Have table foo in two schemas. POST create foo: the filter length is 2, not === 1, so it falls through to CREATE TABLE IF NOT EXISTS foo, which no-ops and still returns 201 (looks like a successful create).
  2. Have foo only in a non-public schema. POST create foo: the filter length is 1, so it returns 409, blocking a legitimate create in the public schema.

Expected

Match on name and schema, and create in a known schema.

Reference

forge/ee/routes/tables/index.js:300-304; create is unqualified in forge/ee/lib/tables/drivers/postgres-supavisor.js:356.

Activity

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

    needs-triageNeeds looking at to decide what to dotype:bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions