diff --git a/src/ast/mod.rs b/src/ast/mod.rs index 3929d228b..1689b56c2 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -3513,7 +3513,7 @@ impl fmt::Display for OnInsert { " ON DUPLICATE KEY UPDATE {}", display_comma_separated(expr) ), - Self::OnConflict(o) => write!(f, " {o}"), + Self::OnConflict(o) => write!(f, "{o}"), } } } diff --git a/tests/sqlparser_postgres.rs b/tests/sqlparser_postgres.rs index d01322301..d17b2e825 100644 --- a/tests/sqlparser_postgres.rs +++ b/tests/sqlparser_postgres.rs @@ -1428,7 +1428,7 @@ fn parse_prepare() { fn parse_pg_on_conflict() { let stmt = pg_and_generic().verified_stmt( "INSERT INTO distributors (did, dname) \ - VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') \ + VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') \ ON CONFLICT(did) \ DO UPDATE SET dname = EXCLUDED.dname", ); @@ -1458,7 +1458,7 @@ fn parse_pg_on_conflict() { let stmt = pg_and_generic().verified_stmt( "INSERT INTO distributors (did, dname, area) \ - VALUES (5, 'Gizmo Transglobal', 'Mars'), (6, 'Associated Computing, Inc', 'Venus') \ + VALUES (5, 'Gizmo Transglobal', 'Mars'), (6, 'Associated Computing, Inc', 'Venus') \ ON CONFLICT(did, area) \ DO UPDATE SET dname = EXCLUDED.dname, area = EXCLUDED.area", ); @@ -1497,7 +1497,7 @@ fn parse_pg_on_conflict() { let stmt = pg_and_generic().verified_stmt( "INSERT INTO distributors (did, dname) \ - VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') \ + VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') \ ON CONFLICT DO NOTHING", ); match stmt { @@ -1516,7 +1516,7 @@ fn parse_pg_on_conflict() { let stmt = pg_and_generic().verified_stmt( "INSERT INTO distributors (did, dname, dsize) \ - VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010) \ + VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010) \ ON CONFLICT(did) \ DO UPDATE SET dname = $1 WHERE dsize > $2", ); @@ -1553,7 +1553,7 @@ fn parse_pg_on_conflict() { let stmt = pg_and_generic().verified_stmt( "INSERT INTO distributors (did, dname, dsize) \ - VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010) \ + VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010) \ ON CONFLICT ON CONSTRAINT distributors_did_pkey \ DO UPDATE SET dname = $1 WHERE dsize > $2", );