darold / pgFormatter

A PostgreSQL SQL syntax beautifier that can work as a console program or as a CGI. On-line demo site at http://sqlformat.darold.net/
PostgreSQL License
1.66k stars 100 forks source link

Wrong indent for WHERE after LEFT JOIN (again) #314

Open codehz opened 1 year ago

codehz commented 1 year ago

version: 5.5 input:

do $$
begin 
select 1 from a left join x on a.id = x.id where a.selected;
end
$$;

output:

DO $$
BEGIN
    SELECT
        1
    FROM
        a
    LEFT JOIN x ON a.id = x.id
WHERE
    a.selected;
END
$$;

like https://github.com/darold/pgFormatter/issues/170 but not same context