On Wednesday, October 31, 2018, PG Bug reporting form <
noreply@postgresql.org> wrote:
Where all columns inputs are strings, if any of those inputs have special
characters like % or '
The only character needing escaping in a normal literal is the single quote since it identifies the end of the literal otherwise. For an escaped string the escaping character (backslash) also needs to be protected. These are the only two and are documented in the sections covering those types. A table containing one or maybe two rows doesn’t seem like an improvement.
In both cases doubling up the special character protects its literal meaning.
Specifically, % is not a special character for literals - though it can be for a particular operator or function. Said operator will then document how it is used.
David J.