Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qeiyw-007hfx-8G for pgsql-docs@arkaria.postgresql.org; Fri, 08 Sep 2023 21:25:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qeiyu-00CvNt-Us for pgsql-docs@arkaria.postgresql.org; Fri, 08 Sep 2023 21:25:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qeiyu-00CvNl-Mz for pgsql-docs@lists.postgresql.org; Fri, 08 Sep 2023 21:25:36 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qeiyq-003xdB-9D for pgsql-docs@lists.postgresql.org; Fri, 08 Sep 2023 21:25:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=Yi1HmaA8L+6VfFP3Z6yw4ur21EYoLybfNTSCYRageJM=; b=3bIWY lYekPodXyV53Cz2Ns75bzUPIxe1zP+xcm5VdawqL09/7b6l+9l+8Nmk8inNwbknMR3LJpzpM+9yfR GDFDTQz7FRUKvnIy0+ypQ+LojyG7lgZQ8feNIQicmXvImmCOOhJzQ6a59TI8JBlSCnLhIx6rDZpdJ 3VKlbOoReEbFHW61GouzWFHVNfkkraiz+TWFrKFm/Jdxlb1gb7QSuw36kYMcNG1elnrSFZWhF6A6e 6EnqGMem/aqOh+e2eLrTE9EmGWI18mNAWWlbHNcSR1eJJsggcKs16vBo2x7gcLXEmXX5Q0Nr+wR56 ezuuiyAoMejIXE8VACdC3mRBI2+Kw==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qeiyo-005S0n-15; Fri, 08 Sep 2023 17:25:30 -0400 Date: Fri, 8 Sep 2023 17:25:30 -0400 From: Bruce Momjian To: Laurenz Albe Cc: pgsql-docs@lists.postgresql.org Subject: Re: Remove obsolete mention of backslashes as escapes Message-ID: References: <0b03f91a875fb44182f5bed9e1d404ed6d138066.camel@cybertec.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b03f91a875fb44182f5bed9e1d404ed6d138066.camel@cybertec.at> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 > 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 '!' > > 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, > PostgreSQL provides another way, called > dollar quoting, to write string constants. > -- > 2.39.2 > -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.