diff --git a/pglast/printers/dml.py b/pglast/printers/dml.py index c7f67a3..ed2874e 100644 --- a/pglast/printers/dml.py +++ b/pglast/printers/dml.py @@ -770,7 +770,7 @@ def insert_stmt(node, output): output.print_list(node.cols) output.write(')') else: - output.write(' ') + output.separator() if node.override: if node.override == enums.OverridingKind.OVERRIDING_USER_VALUE: output.write(' OVERRIDING USER VALUE ') diff --git a/tests/test_printers_prettification/dml/insert.sql b/tests/test_printers_prettification/dml/insert.sql index 522af2f..3280442 100644 --- a/tests/test_printers_prettification/dml/insert.sql +++ b/tests/test_printers_prettification/dml/insert.sql @@ -26,3 +26,9 @@ VALUES (1, 'this is short enough'), (2, 'this is too long, and will be splitted') : {'comma_at_eoln': True} + +insert into foo select * from bar += +INSERT INTO foo +SELECT * +FROM bar