pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-docs@lists.postgresql.org
Subject: Remove obsolete mention of backslashes as escapes
Date: Tue, 11 Apr 2023 09:54:11 +0200
Message-ID: <0b03f91a875fb44182f5bed9e1d404ed6d138066.camel@cybertec.at> (raw)

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&amp;'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



view thread (4+ messages)  latest in thread

Message-ID: <0b03f91a875fb44182f5bed9e1d404ed6d138066.camel@cybertec.at>
Permalink:  ../0b03f91a875fb44182f5bed9e1d404ed6d138066.camel@cybertec.at/
Also on:    postgresql.org/message-id/0b03f91a875fb44182f5bed9e1d404ed6d138066.camel@cybertec.at

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: laurenz.albe@cybertec.at, pgsql-docs@lists.postgresql.org
  Subject: Re: Remove obsolete mention of backslashes as escapes
  In-Reply-To: <0b03f91a875fb44182f5bed9e1d404ed6d138066.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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