pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedRemove obsolete mention of backslashes as escapes
4+ messages / 3 participants
[nested] [flat]
* Remove obsolete mention of backslashes as escapes
@ 2023-04-11 07:54 Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 2 replies; 4+ messages in thread
From: Laurenz Albe @ 2023-04-11 07:54 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org
The documentation in
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING
says that
"While the standard syntax for specifying string constants is usually convenient,
it can be difficult to understand when the desired string contains many single
quotes or backslashes, since each of those must be doubled."
But this has been obsolete ever since version 9.1, when "standard_conforming_strings"
started to default to "on". It has confused at least one reader:
https://dba.stackexchange.com/q/325850/176905
So I propose to remove the mention of backslashes there.
Yours,
Laurenz Albe
Attachments:
[text/x-patch] 0001-Remove-obsolete-mention-of-backslashes-as-escapes.patch (1.2K, ../../0b03f91a875fb44182f5bed9e1d404ed6d138066.camel@cybertec.at/2-0001-Remove-obsolete-mention-of-backslashes-as-escapes.patch)
download | inline diff:
From 282d2dae27524aef37cdafe02e4833894bf5892c Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Tue, 11 Apr 2023 09:48:20 +0200
Subject: [PATCH] Remove obsolete mention of backslashes as escapes
Since version 9.1, standard_conforming_strings defaults to "on".
So the remark that backslashes must be doubled has been obsolete
for a long time and should be removed. It is more confusing than
helpful by now.
---
doc/src/sgml/syntax.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml
index 5668ab0143..3ba844057f 100644
--- a/doc/src/sgml/syntax.sgml
+++ b/doc/src/sgml/syntax.sgml
@@ -555,7 +555,7 @@ U&'d!0061t!+000061' UESCAPE '!'
<para>
While the standard syntax for specifying string constants is usually
convenient, it can be difficult to understand when the desired string
- contains many single quotes or backslashes, since each of those must
+ contains many single quotes, since each of those must
be doubled. To allow more readable queries in such situations,
<productname>PostgreSQL</productname> provides another way, called
<quote>dollar quoting</quote>, to write string constants.
--
2.39.2
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Remove obsolete mention of backslashes as escapes
@ 2023-04-12 22:21 Kirk Wolak <wolakk@gmail.com>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 0 replies; 4+ messages in thread
From: Kirk Wolak @ 2023-04-12 22:21 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-docs@lists.postgresql.org
On Tue, Apr 11, 2023 at 3:54 AM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:
> The documentation in
>
> https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING
> says that
>
> "While the standard syntax for specifying string constants is usually
> convenient,
> it can be difficult to understand when the desired string contains many
> single
> quotes or backslashes, since each of those must be doubled."
>
> But this has been obsolete ever since version 9.1, when
> "standard_conforming_strings"
> started to default to "on". It has confused at least one reader:
> https://dba.stackexchange.com/q/325850/176905
>
> So I propose to remove the mention of backslashes there.
>
> Yours,
> Laurenz Albe
>
+1 I like this.. It's more clear and more accurate!
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Remove obsolete mention of backslashes as escapes
@ 2023-09-08 21:25 Bruce Momjian <bruce@momjian.us>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 1 reply; 4+ messages in thread
From: Bruce Momjian @ 2023-09-08 21:25 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-docs@lists.postgresql.org
Thanks, patch applied back to PG 11.
---------------------------------------------------------------------------
On Tue, Apr 11, 2023 at 09:54:11AM +0200, Laurenz Albe wrote:
> The documentation in
> https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING
> says that
>
> "While the standard syntax for specifying string constants is usually convenient,
> it can be difficult to understand when the desired string contains many single
> quotes or backslashes, since each of those must be doubled."
>
> But this has been obsolete ever since version 9.1, when "standard_conforming_strings"
> started to default to "on". It has confused at least one reader:
> https://dba.stackexchange.com/q/325850/176905
>
> So I propose to remove the mention of backslashes there.
>
> Yours,
> Laurenz Albe
> From 282d2dae27524aef37cdafe02e4833894bf5892c Mon Sep 17 00:00:00 2001
> From: Laurenz Albe <laurenz.albe@cybertec.at>
> Date: Tue, 11 Apr 2023 09:48:20 +0200
> Subject: [PATCH] Remove obsolete mention of backslashes as escapes
>
> Since version 9.1, standard_conforming_strings defaults to "on".
> So the remark that backslashes must be doubled has been obsolete
> for a long time and should be removed. It is more confusing than
> helpful by now.
> ---
> doc/src/sgml/syntax.sgml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml
> index 5668ab0143..3ba844057f 100644
> --- a/doc/src/sgml/syntax.sgml
> +++ b/doc/src/sgml/syntax.sgml
> @@ -555,7 +555,7 @@ U&'d!0061t!+000061' UESCAPE '!'
> <para>
> While the standard syntax for specifying string constants is usually
> convenient, it can be difficult to understand when the desired string
> - contains many single quotes or backslashes, since each of those must
> + contains many single quotes, since each of those must
> be doubled. To allow more readable queries in such situations,
> <productname>PostgreSQL</productname> provides another way, called
> <quote>dollar quoting</quote>, to write string constants.
> --
> 2.39.2
>
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Only you can decide what is important to you.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Remove obsolete mention of backslashes as escapes
@ 2023-09-09 02:56 Laurenz Albe <laurenz.albe@cybertec.at>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 4+ messages in thread
From: Laurenz Albe @ 2023-09-09 02:56 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-docs@lists.postgresql.org
On Fri, 2023-09-08 at 17:25 -0400, Bruce Momjian wrote:
> Thanks, patch applied back to PG 11.
Thank you!
Laurenz Albe
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2023-09-09 02:56 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-04-11 07:54 Remove obsolete mention of backslashes as escapes Laurenz Albe <laurenz.albe@cybertec.at>
2023-04-12 22:21 ` Kirk Wolak <wolakk@gmail.com>
2023-09-08 21:25 ` Bruce Momjian <bruce@momjian.us>
2023-09-09 02:56 ` Laurenz Albe <laurenz.albe@cybertec.at>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox