Using pgformatter in dbeaver, a separate formatter inside the exists parentheses will not give an error, but SQL cannot be formatted as shown below. The error message is as follows
SQL:select * from ta mm where 1=1 and exists
(SELECT 1 FROM table1 a
INNER JOIN table2 ct ON
((ct.c1=a.c1 AND lev=1)
OR (a.c2 IS NULL AND ct.c1=a.c1)
OR (a.c2 IS NOT NULL AND ct.c1=a.c2))
AND mm.id=a.id)
ERROR:
Uncaught exception: Use of uninitialized value in pattern match (m//) at D:/Program Files/pgFormatter-5.5/lib/pgFormatter/Beautify.pm line 968, line 1.
at D:\Program Files\pgFormatter-5.5\pg_format line 19, line 1.
main::ANON("Use of uninitialized value in pattern match (m//) at D:/Progr"...) called at D:/Program Files/pgFormatter-5.5/lib/pgFormatter/Beautify.pm line 968
pgFormatter::Beautify::beautify(pgFormatter::Beautify=HASH(0x1a9ffd2e5f0)) called at D:/Program Files/pgFormatter-5.5/lib/pgFormatter/CLI.pm line 170
pgFormatter::CLI::beautify(pgFormatter::CLI=HASH(0x1a9fd5ac170)) called at D:/Program Files/pgFormatter-5.5/lib/pgFormatter/CLI.pm line 78
pgFormatter::CLI::run(pgFormatter::CLI=HASH(0x1a9fd5ac170)) called at D:\Program Files\pgFormatter-5.5\pg_format line 49
Using pgformatter in dbeaver, a separate formatter inside the exists parentheses will not give an error, but SQL cannot be formatted as shown below. The error message is as follows
SQL:select * from ta mm where 1=1 and exists (SELECT 1 FROM table1 a
INNER JOIN table2 ct ON
((ct.c1=a.c1 AND lev=1) OR (a.c2 IS NULL AND ct.c1=a.c1) OR (a.c2 IS NOT NULL AND ct.c1=a.c2)) AND mm.id=a.id)
ERROR: Uncaught exception: Use of uninitialized value in pattern match (m//) at D:/Program Files/pgFormatter-5.5/lib/pgFormatter/Beautify.pm line 968, line 1.
at D:\Program Files\pgFormatter-5.5\pg_format line 19, line 1.
main::ANON("Use of uninitialized value in pattern match (m//) at D:/Progr"...) called at D:/Program Files/pgFormatter-5.5/lib/pgFormatter/Beautify.pm line 968
pgFormatter::Beautify::beautify(pgFormatter::Beautify=HASH(0x1a9ffd2e5f0)) called at D:/Program Files/pgFormatter-5.5/lib/pgFormatter/CLI.pm line 170
pgFormatter::CLI::beautify(pgFormatter::CLI=HASH(0x1a9fd5ac170)) called at D:/Program Files/pgFormatter-5.5/lib/pgFormatter/CLI.pm line 78
pgFormatter::CLI::run(pgFormatter::CLI=HASH(0x1a9fd5ac170)) called at D:\Program Files\pgFormatter-5.5\pg_format line 49