cockroachdb / cockroachdb/cockroach
sql: support `function_name.argument_name` references in UDFs
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
From the [Postgres docs](https://www.postgresql.org/docs/15/xfunc-sql.html):
> If the argument name is the same as any column name in the current SQL command within the function, the column name will take precedence. To override this, qualify the argument name with the name of the function itself, that is function_name.argument_name. (If this would conflict with a qualified column name, again the column name wins. You can avoid the ambiguity by choosing a different alias for the table within the SQL command.)
We don't yet support referencing a function argument with `function_name.argument_name`.
Jira issue: CRDB-27662
Contributor guide
Research direction
The issue names no source file or test entry point. Start with the linked PostgreSQL documentation and locate CockroachDB's SQL UDF argument-resolution code; done means function_name.argument_name references work and follow the documented precedence rules when names conflict with columns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100