Skip to content

Parse error in SET column[index] = value at PostgreSQL UPDATE statement #123

Description

@nene

The following fails to parse:

UPDATE my_table SET my_col[2] = 3.0760;

From PostgreSQL docs:

The column name can be qualified with a subfield name or array subscript, if needed.

There's also more syntax which we don't support:

SET col[1:2] =
SET col.field1.field2 =
SET col.* =  -- supported by parser, but rejected by semantic analysis

See PostgreSQL grammar.

Need to check if these all are actually supported in SET. The PostgreSQL parser might parses these, but the construct might get rejected.

The same syntax is also possible in INSERT columns, like:

INSERT INTO foo (col[1], col[2], col[3]) VALUES (5, 4, 3);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions