Skip to content

[schemas] Fix typed-reasoning-edges COMMENT syntax error#233

Open
AnkitClassicVision wants to merge 4 commits intoNateBJones-Projects:mainfrom
AnkitClassicVision:contrib/AnkitClassicVision/fix-typed-edges-comment-concat
Open

[schemas] Fix typed-reasoning-edges COMMENT syntax error#233
AnkitClassicVision wants to merge 4 commits intoNateBJones-Projects:mainfrom
AnkitClassicVision:contrib/AnkitClassicVision/fix-typed-edges-comment-concat

Conversation

@AnkitClassicVision
Copy link
Copy Markdown

Summary

The COMMENT ON FUNCTION public.thought_edges_upsert IS clause uses runtime string concatenation ('...' || '...' || '...'), which Postgres rejects. COMMENT requires a single string literal, not an expression.

Repro

Apply the schema against Supabase:

supabase db query --linked --file schemas/typed-reasoning-edges/schema.sql

Fails with:

ERROR:  42601: syntax error at or near "||"
LINE 258:   'Insert or (on duplicate key) bump support_count + refresh temporal bounds. ' ||

Fix

Replaced || with SQL-standard adjacent-string-literal concatenation — the parser joins adjacent 'a' 'b' into 'ab' when separated only by whitespace, so the multi-line source stays readable while producing a valid single literal.

-- before
COMMENT ON FUNCTION public.thought_edges_upsert IS
  'Insert or (on duplicate key) ... ' ||
  'Call via POST ... ' ||
  'you want ...';

-- after
COMMENT ON FUNCTION public.thought_edges_upsert IS
  'Insert or (on duplicate key) ... '
  'Call via POST ... '
  'you want ...';

Test plan

  • Hit the original error by applying schema as-is
  • Apply patched schema against a Supabase Pro project — applies cleanly
  • Verify \df+ public.thought_edges_upsert shows the merged description

🤖 Generated with Claude Code

AnkitClassicVision and others added 4 commits April 22, 2026 14:03
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove duplicated MyBCAT Universal Rules block from repo CLAUDE.md.
Rules are now inherited via /repos/.claude/CLAUDE.md (Claude Code walks
up the directory tree). Saves ~1,165 tokens per session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The COMMENT ON FUNCTION public.thought_edges_upsert IS clause used runtime
string concatenation ('...' || '...' || '...') which Postgres rejects —
COMMENT requires a single string literal, not an expression.

Replaced the || operators with SQL-standard adjacent-string-literal
concatenation (the parser joins adjacent 'a' 'b' into 'ab' when separated
only by whitespace), keeping the source readable on multiple lines while
producing a valid literal.

Repros via: supabase db query --linked --file schemas/typed-reasoning-edges/schema.sql
Before: ERROR 42601 syntax error at or near "||"
After:  applies cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation recipe Contribution: step-by-step recipe schema Contribution: database extension labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation recipe Contribution: step-by-step recipe schema Contribution: database extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant