Skip to content

Can't parse jsonb extractions in an on conflict in Postgres #1977

@stevenliebregt

Description

@stevenliebregt

The parser does not support the following:

INSERT INTO table_with_constraint_over_jsonb (a_number, a_jsonb, a_string) 
VALUES ($1, $2, $3) 
ON CONFLICT (a_number, (a_jsonb->>'name')) 
DO UPDATE SET a_string = EXCLUDED.a_string 
RETURNING *;

It errors on the (a_jsonb->>'name') part with the error: ParserError("Expected: identifier, found: ( at Line: 1, Column: 119").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions