Problem
A -- comment just before a parenthesized subquery loses the newline that ends it. The subquery then goes onto the comment line, and PostgreSQL reads it as part of the comment. The output does not parse.
This occurs in every style except pg_dump (fixed for pg_dump in #59). It also occurs on main.
Reproduce
SELECT a FROM t WHERE x IN -- note
(SELECT 1);
river output:
SELECT a
FROM t
WHERE x IN -- note (SELECT 1)
;
Formatting the output again fails: Syntax error at line 3, column 10: "IN". mozilla, aweber, dbt, gitlab, kickstarter and mattmc3 give the same result.
Expected
The newline after the comment stays, so (SELECT 1) remains SQL.
Related
Problem
A
--comment just before a parenthesized subquery loses the newline that ends it. The subquery then goes onto the comment line, and PostgreSQL reads it as part of the comment. The output does not parse.This occurs in every style except
pg_dump(fixed forpg_dumpin #59). It also occurs onmain.Reproduce
riveroutput:Formatting the output again fails:
Syntax error at line 3, column 10: "IN". mozilla, aweber, dbt, gitlab, kickstarter and mattmc3 give the same result.Expected
The newline after the comment stays, so
(SELECT 1)remains SQL.Related