Skip to content

Escape character + escaped double quote makes formatted SQL invalid #61

@jzillmann

Description

@jzillmann

In Postgres such a query is valid:

select A as "A\""B" from "T1";

The single result column will be named A\"B.
The backslash escape isn't used as escape here, the first inner " will escape the following ".
To demonstrate the logic a bit more a few examples:

  • A\B => A\B
  • A""B => A"B

Now the formatter chokes on this.

select A as "A\""B" from "T1";

will be formatted as

select A as "A\"" B " from " T1 ";

Which is not even executable anymore.
Is there any configuration that could alleviate this problem ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions