Skip to content

Commit

Permalink
Avoid spurious space in INSERT without explicit columns
Browse files Browse the repository at this point in the history
  • Loading branch information
lelit committed Jun 18, 2022
1 parent aa80697 commit 74f3abc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pglast/printers/dml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ')
Expand Down
6 changes: 6 additions & 0 deletions tests/test_printers_prettification/dml/insert.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 74f3abc

Please sign in to comment.