functions.create/retrieve fails for multi-word argument types
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- postgresql, typescript
Research direction
Start at the functions.retrieve argument-type resolution path, then check how functions.create retrieves the newly created function. Reproduce the issue with double precision and timestamp with time zone arguments, and verify that full type names resolve while an optional leading argument name is ignored.
Written by the indexing model from the issue text.
Description
Bug
functions.retrieve({ args }) (and therefore functions.create, which retrieves after create) resolves each arg to a type by taking only the last space-separated token and casting it to regtype:
STRING_TO_ARRAY(arg, ' ')[last]::regtype
That breaks SQL-standard multi-word types:
| arg | last token | result |
|---|---|---|
double precision |
precision |
invalid type name "precision" |
timestamp with time zone |
zone |
error |
x double precision |
precision |
error |
Repro
await pgMeta.functions.create({
name: 'test_multiword_arg',
schema: 'public',
args: ['x double precision', 'ts timestamp with time zone'],
definition: 'select x',
return_type: 'double precision',
language: 'sql',
behavior: 'STABLE',
security_definer: false,
})
// CREATE succeeds; retrieve-by-args fails → create returns an error
Expected
Args should resolve using the full type name (and drop only an optional leading parameter name), so Studio/API can create and look up functions with common SQL types.
- 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 76/100
supabase/postgres-meta#1143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
supabase/postgres-meta#1142 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
supabase/postgres-meta#1140 ·
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 ·