Bug
Updating a column via postgres-meta (PATCH /columns / columns.update) to clear or replace a check constraint fails when the existing check constraint name is not a plain unquoted identifier (e.g. hyphenated names like "t-c-check").
The generated SQL uses DROP CONSTRAINT %s, which interpolates the name without quoting. PostgreSQL then treats the hyphen as an operator and raises a syntax error. Unique-constraint drops in the same code path already use quote_ident; check drops should use identifier quoting (%I) as well.
Repro
create table public.t (c int8);
alter table public.t add constraint "t-c-check" check (c <> 0);
Then clear the check through postgres-meta:
const col = await pgMeta.columns.retrieve({ schema: 'public', table: 't', name: 'c' })
await pgMeta.columns.update(col.data!.id, { check: null })
Expected: check removed (check: null).
Actual: SQL error near - from DROP CONSTRAINT t-c-check (unquoted).
Impact
Studio / Management API column edits that clear or change checks break for any table whose check constraint was named with quotes, hyphens, mixed case, etc. (common when tools or users pick explicit constraint names).
Bug
Updating a column via postgres-meta (
PATCH /columns/columns.update) to clear or replace a check constraint fails when the existing check constraint name is not a plain unquoted identifier (e.g. hyphenated names like"t-c-check").The generated SQL uses
DROP CONSTRAINT %s, which interpolates the name without quoting. PostgreSQL then treats the hyphen as an operator and raises a syntax error. Unique-constraint drops in the same code path already usequote_ident; check drops should use identifier quoting (%I) as well.Repro
Then clear the check through postgres-meta:
Expected: check removed (
check: null).Actual: SQL error near
-fromDROP CONSTRAINT t-c-check(unquoted).Impact
Studio / Management API column edits that clear or change checks break for any table whose check constraint was named with quotes, hyphens, mixed case, etc. (common when tools or users pick explicit constraint names).