You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Table delete returns "Table not found" for a table name used in two schemas #8852
DELETE /api/v1/teams/:teamId/databases/:databaseId/tables/:tableName/:schemaName? takes the schema as an optional path segment. Without it, a table name that exists in more than one schema returns 404 table_not_found, although the table exists. The caller is not told that the schema is needed.
Steps to reproduce
Using a Postgres tables driver, create table t in schema public and table t in schema s2.
DELETE .../tables/t. It returns 404 { "code": "table_not_found", "error": "Table not found" }.
DELETE .../tables/t/s2 returns 204, and DELETE .../tables/t then returns 204 too.
Expected
When the name matches more than one table, the route returns 400 (or 409) saying the name exists in several schemas and a schema must be given.
Also
The postgres-localfs driver's dropTable throws Failed to create table ... when the drop fails, so the error reads as a create failure. The supavisor driver says Failed to drop table.
Reference
forge/ee/routes/tables/index.js:398-407 requires exactly one match and answers 404 otherwise.
forge/ee/lib/tables/drivers/postgres-localfs.js:361, compared with postgres-supavisor.js:441.
Activity