diff --git a/src/ast/mod.rs b/src/ast/mod.rs index ab917dc4c..555d9fb81 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 606d835f1..3d0eedac6 100644 --- a/tests/sqlparser_postgres.rs +++ b/tests/sqlparser_postgres.rs @@ -1421,7 +1421,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", ); @@ -1451,7 +1451,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", ); @@ -1490,7 +1490,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 { @@ -1509,7 +1509,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", ); @@ -1546,7 +1546,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", );