Repository navigation
feat(analysis): treat subscripted array columns as expressions - #77
Merged
omer-cengel merged 1 commit intoOct 11, 2026
Merged
Conversation
omer-cengel
deleted the
feature/subscripted-array-columns-as-expressions
branch
October 11, 2026 19:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A column reference written with an array subscript or slice, such as
labels[1],labels[1:2], ort.labels[1], was analyzed as the whole array column. A projection of it generated aListcomponent and a placeholder compared with it bound aList, both of which compiled but failed against PostgreSQL. Such a reference is now analyzed as an expression, so its type must be stated with a cast.Changes
labels[1]::text AS firstis aStringcomponent, andlabels[1:2]::varchar[] AS pairis a list component.RETURNINGitem is rejected as a computed returned item, with or without an alias.IN,LIKE,BETWEEN,= ANY, joinONconditions, writeWHEREclauses,DO UPDATE ... WHERE,SETassignments, andINSERTvalues.param<N>, solabels[1] = $1::textbindsparam1.SETorINSERTtarget must still name an existing column, and the subscript reaches the database as written.Scope and non-goals
EXCLUDEDvalues, and conflict targets keep their existing column checks.(labels)[1]andlabels[1][2], and open slices are not changed.