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

Create Table with "WITH" Inline Function Not Have Correct Indentation #324

Open lih3120 opened 11 months ago

lih3120 commented 11 months ago

If we put the following procedure into the pgFormatter, we will see the indentation is not right: The end ")" comes to the very beginning of the line. Also the keyword "with" is not uppercased nor is highlighted.

CREATE OR REPLACE PROCEDURE test () LANGUAGE plpgsql AS $$ BEGIN CREATE temp TABLE test AS with reg_data AS ( SELECT buyer FROM reg WHERE status = 'Enabled' ) SELECT buyer FROM reg_data;

END; $$