cockroachdb / cockroachdb/cockroach
plpgsql: report ambiguous column error for conflicting variable names
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
By default, when a PLpgSQL variable conflicts with a column name, the result is an ambiguous column error. It is also possible to change the `plpgsql.variable_conflict` setting in order to prefer either columns or variables in such cases. See the postgres docs here: https://www.postgresql.org/docs/current/plpgsql-implementation.html#PLPGSQL-VAR-SUBST
Currently, CRDB resolves ambiguous cases as column references rather than variable references.
Jira issue: CRDB-34151
Contributor guide
Research direction
Start with the PostgreSQL PL/pgSQL variable-conflict documentation linked in the issue, then locate CockroachDB’s existing PL/pgSQL name-resolution handling and regression tests. Confirm the current column-preference behavior, add coverage for an ambiguous variable and column reference, and ensure it reports the ambiguity as PostgreSQL does.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgres, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100