Skip to content

Postgres: [pg on conflict method] does not support 'where' condition. #733

Closed
@zidaye

Description

@zidaye
#[test]
fn test_pg_on_conflict() {
     let pg_dialect = PostgreSqlDialect {};
     let sql = r#" INSERT INTO distributors (did, dname, dsize)  VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010)  ON CONFLICT(did)  DO UPDATE SET dname = $1 WHERE dsize > $2"#;
     let mut ast = Parser::parse_sql(&pg_dialect, sql).unwrap();
}

The result after the test case is executed:

thread 'test_pg_on_conflicts' panicked at 'called `Result::unwrap()` on an `Err` value: ParserError("Expected end of statement, found: WHERE")',

version: main [branch]

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