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 1sGfmJ-00FmJF-KT for pgsql-general@arkaria.postgresql.org; Mon, 10 Jun 2024 14:13:44 +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 1sGfmG-00Ccf0-Sh for pgsql-general@arkaria.postgresql.org; Mon, 10 Jun 2024 14:13:41 +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 1sGfmG-00Cces-EN for pgsql-general@lists.postgresql.org; Mon, 10 Jun 2024 14:13:41 +0000 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sGfmE-000wfC-E4 for pgsql-general@postgresql.org; Mon, 10 Jun 2024 14:13:40 +0000 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-5b970a97e8eso2486981eaf.1 for ; Mon, 10 Jun 2024 07:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718028816; x=1718633616; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0i7pl94x0coRc1aOoXDK9S6Eqy5qQRyUVbFl+vosju0=; b=Vpw/Kc3yfVEhJawQBHHMu8n/5uNIJQVI3H+/WTQuS+kjiNPiSYIeAjsHKG0Jt36/3r 5KW05KxDdl37Q9KSFIH134Gf7S/X29uECjAKIyn0yBwXaRMccl0odhAfKMstzdSGnsga 03+w8y70upEdG4bC0dEfU9LyFkfkFTCHJBgT3Y8hrd1Z37tFzLHBRkRa1ne/MOg2cyBF NNEFowFgaafLf4c95j9QFixC7NS5UlOtlU5pWXRk0wAR2xE3BWLPgGVKD7jUnu86IkK3 DxfJ71Zmy2SioGt44c2yQiOAxBQ12iqCCR+rnt1VQW7s/fAKvU6eyariUU+9GC5x3rrc h0lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718028816; x=1718633616; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0i7pl94x0coRc1aOoXDK9S6Eqy5qQRyUVbFl+vosju0=; b=oj/nwsDLeFxCcnC8pACR3zOM3Co9w4qzESYCVFNI8Mz8W1D0QPxwWDp85vqYoEbOVE 3aXk2smvcL36FwfCJvW8MV20PYU8WMCBHuvOkw47inX9xMR3LLJtU1EpBsQaOKMIyOmi +FzgfO2zJwza8nH/3HeZfHNSPwKS2S27tjeAQNei5/EbWaU7QjUwVZUddZRbP658nGcw 0m789Yyil+nhFIhdi3ImTuDQtU5c2jW/nHia0xDuJtioH8AQOPYv1wQQyTweDSMBR/+V IF0zMFskd+NI2STV6N7RVM9ml6CmHo/HkOlldB0mFUuLlui9Pr2jdVD1gtAqgUb6hNx2 l0yQ== X-Gm-Message-State: AOJu0Yy22QfsPCzbokmTbkeXdqs+/MXcXBp+t7MNN8rmK4iEMqlDnbTC x6qda2VVI8RDtQ893hc3XB+YEFdg70Rz2hyXRx2S6zynegLOndMbShBB+9zgNChg6u260UjdIXt Uu8zEkERYatyyDuiqFeef34mlNVbKTQ== X-Google-Smtp-Source: AGHT+IFCBsjmmjElAnR4Bdt6OFFPGf1irhulkvWwYjU3q6y1Q8kd39Hk4HBzj7/ewMwJs0Pm3cDKDOORB/fYIvfxJG8= X-Received: by 2002:a05:6820:82a:b0:5bb:1b9d:24ed with SMTP id 006d021491bc7-5bb1b9d2865mr665547eaf.4.1718028816510; Mon, 10 Jun 2024 07:13:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Mon, 10 Jun 2024 07:12:57 -0700 Message-ID: Subject: Re: Escaping single quotes with backslash seems not to work To: Ron Johnson Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000005279fe061a89c113" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005279fe061a89c113 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 10, 2024 at 7:07=E2=80=AFAM David G. Johnston < david.g.johnston@gmail.com> wrote: > On Mon, Jun 10, 2024 at 7:02=E2=80=AFAM Ron Johnson > wrote: > >> PG 9.6 and PG 14 >> >> >> https://www.postgresql.org/docs/14/sql-syntax-lexical.html#SQL-SYNTAX-CO= NSTANTS >> >> [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. --0000000000005279fe061a89c113 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jun 10, 2024 at 7:07=E2=80=AFAM David G. Johnston = <david.g.johnston@gmail.co= m> wrote:
=
On Mon, Jun 10, 2024 at 7:02=E2=80=AFAM R= on Johnson <ronljohnsonjr@gmai= l.com> wrote:=
[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 b= y writing=C2=A0\', in addition to the norma= l way of=C2=A0''.
= [/quote]

=

The li= nk you provided goes to the wrong subsection.

Ah...you just linked to the section on constants w= here all the various incarnations are subsections.

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

David J.

--0000000000005279fe061a89c113--