pgFormatter icon indicating copy to clipboard operation
pgFormatter copied to clipboard

Indentation of function body

Open alehaa opened this issue 3 years ago • 0 comments

When I run pg_format 5.2 on a plain SQL function, its body gets formatted weird:

pg_format           \
    --nocomment     \
    --spaces 2      \
    --wrap-limit 80 \
    hello.sql
CREATE OR REPLACE FUNCTION hello ()
  RETURNS VOID
  LANGUAGE SQL
  AS $$
  CREATE TEMP VIEW foo AS TABLE orig_foo;

CREATE TEMP VIEW bar AS TABLE orig_bar;

$$;

In my opinion, all commands of the function body should be indented the same and no newlines be placed between them.

alehaa avatar Mar 22 '22 07:03 alehaa