Column update DROP CONSTRAINT fails for hyphenated check names
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- postgresql, typescript
Research direction
Start at the postgres-meta columns.update path used by PATCH /columns and compare check-constraint removal with the existing unique-constraint drop logic that uses quote_ident. Reproduce with the provided hyphenated constraint name, then verify that clearing the check succeeds and the constraint is removed without a PostgreSQL syntax error.
Written by the indexing model from the issue text.
Description
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).
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 223
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/postgres-meta
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
supabase/postgres-meta#1150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
supabase/postgres-meta#1147 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
supabase/postgres-meta#1146 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
supabase/postgres-meta#1143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
supabase/postgres-meta#1142 ·
All issues in supabase/postgres-meta
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·