Re: Escaping single quotes with backslash seems not to work - Mailing list pgsql-general

From David G. Johnston
Subject Re: Escaping single quotes with backslash seems not to work
Date
Msg-id CAKFQuwYGJ-PoPr50SpWW3Dmn0_aG9TxCobDkjehP9uekOO+_og@mail.gmail.com
Whole thread Raw
In response to Re: Escaping single quotes with backslash seems not to work  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On Mon, Jun 10, 2024 at 7:07 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Mon, Jun 10, 2024 at 7:02 AM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
PG 9.6 and PG 14

[quote]
Any other character following a backslash is taken literally. Thus, to include a backslash character, write two backslashes (\\). Also, a single quote can be included in an escape string by writing \', in addition to the normal way of ''.
[/quote]


The link you provided goes to the wrong subsection.

Ah...you just linked to the section on constants where all the various incarnations are subsections.

It would be a nice addition to include some examples in the section pertaining to escape syntax.  Make it more clear how it differs from just a non-escaping literal.  Maybe put something like \n into the basic literal section showing that it outputs the literal two characters instead of a newline.

David J.

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Escaping single quotes with backslash seems not to work
Next
From: Dominique Devienne
Date:
Subject: libpq v17 PQsocketPoll timeout is not granular enough