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.69k stars 101 forks source link

Single quotes inside /**/ comments break formatting #338

Closed jakob closed 6 months ago

jakob commented 7 months ago

The following is incorrectly formatted:

/* comment with a single quote ' */ SELECT 'XYZ';

becomes:

* comment WITH a single quote ' */ SELECT ' XYZ ';

The problem is only with single quotes. Double quotes seem to work as expected:

/* double quote " */ select 1 as "one"

becomes

/* double quote " */
SELECT
    1 AS "one"
darold commented 6 months ago

Commit 459e503 fixes this issue.