Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxYgE-0000PV-3A for pgsql-general@arkaria.postgresql.org; Tue, 22 Nov 2022 19:11:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oxYgD-00089u-0A for pgsql-general@arkaria.postgresql.org; Tue, 22 Nov 2022 19:11:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxYgC-00089k-KM for pgsql-general@lists.postgresql.org; Tue, 22 Nov 2022 19:11:36 +0000 Received: from sonic320-29.consmr.mail.bf2.yahoo.com ([74.6.128.210]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oxYg9-0005bt-Qf for pgsql-general@lists.postgresql.org; Tue, 22 Nov 2022 19:11:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1669144290; bh=fx9c4Vbf2q9jkkBJrZZdn+rWwRVQYvNuF+w0TZVVmKw=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=KBMYF3eRIyR3OpBQCX/QTrTRI9tjESdmncAS9/9izJus2od9Ldr9mpcsT55+aR2QzZCNpV9GWPmiuYILE7iG+eQcmoSMCBz5EYlc7Tz3YPXN5FSSnMIQdW4QEfLqwJ04oFkZq2DpCqFQRKEJ3PngQCUWmuSk9nqziYEtv/DlBjrxYTzMaL1NClfO4UMYiljcRRQHKt8j5ZvSS2IniA628qYt4rK1L++R7dS2lHbR+BPDmbR2TX0K64Oo1ZSq0OamlMHn0JqPJChS/rLdxS0PRkluaGvTpC2xfJS3RTMeZKyGi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fUeiklZvqMNZL9WsQUpU7v3fOnTfcB3rZRLLRbOL5s3t210B.4XfA IUxinyLLkGHb_xOxadWBqwLQqPT5uMuz1squb737YCAp6EyHMOnqka1BUhDfB8_mfToM7n9VW9fz PiN6D4037dkMENvBtfBDzh1tjv_A51YGhy4kk_b3qdQzw1isJY1m5.zDqCjC7b7.mGtebDo3bZLO F5D_Q.0Vdekygf7TpVO5nAqHYOgjZJk17v5vBJ9DtqtbUB.vLGDIiX7hS7tS6Nr7LuITsrESryOB JZkUcutO_m0jfJyop9z2D3PwHjy930Mp8.IZFE3u9TBYYFa.oOXrF7Kq4mJ4wjEX6tkVxxS5RI.6 DpjppkgR8ueYL7v8cQFY5R1sl8XfYjwFcgRsgPzxCUW5lrPwFNUkh_dd.vgEXNru0zlqbZ4fexmW ULh1MteAs5SkiA.wiX0c4i21JcFWsURwk6MXNuCIVBW.vk4wOOWUjggjwEJhIZAm6LKAfibSF8rS sunqsenORu.68eSuG.fuqQU7vcZHjuw50VeWkYZCu.6jSC8uVVT4OZ4nPp0G21Bx7vg0EW0HHyXJ KFJ4tjb7IBBtu8_9xanMDWZa9HybE26tz0H1YALOwlgHuuLs7_QKJfJlnc3v7_mVDCneKSU4JsoH V5.xJNA-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic320.consmr.mail.bf2.yahoo.com with HTTP; Tue, 22 Nov 2022 19:11:30 +0000 Date: Tue, 22 Nov 2022 19:11:25 +0000 (UTC) From: "pbj@cmicdo.com" To: "pgsql-general@lists.postgresql.org" , "Peter J. Holzer" Message-ID: <329136653.2014260.1669144285438@mail.yahoo.com> In-Reply-To: <20221122181550.lgobhgfzvtgp7jes@hjp.at> References: <1342743333.378397.1669130157980@office.mailbox.org> <1999020343.1943388.1669131046107@mail.yahoo.com> <20221122181550.lgobhgfzvtgp7jes@hjp.at> Subject: Re: copying json data and backslashes MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2014259_682509660.1669144285436" X-Mailer: WebService/1.1.20863 YMailNorrin Content-Length: 5095 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_2014259_682509660.1669144285436 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =20 On Tuesday, November 22, 2022 at 01:16:02 PM EST, Peter J. Holzer wrote: =20 =C2=A0> On 2022-11-22 17:39:04 +0000, Alastair McKinley wrote: =C2=A0> > > \copy footable from 'input.json' (format csv, escape '^B', deli= mieter '^C ', quote '^E') =C2=A0> > > =C2=A0> > > where the control characters are the actual control char, not t= he =C2=A0> > > caret-letter, and it requires no escaping escapes.=C2=A0 I real= ize this =C2=A0> > > won't work for all =C2=A0> > > situations. =C2=A0> > =C2=A0> > Thanks for the suggestion, this is interesting to me to try but I= am =C2=A0> > not quite sure how this works. =C2=A0> > As far as I understand, escape/quote/delimiter have to be a singl= e =C2=A0> > character, and CTRL-C etc. are multiple characters. =C2=A0> Yes, Alastair, Peter said what I would have... =C2=A0> You may have to hit several Keys[1] on your keyboard, but Ctrl-C is= a =C2=A0> single character, just like Shift-C is (the former has code 0003, t= he =C2=A0> latter 0043). =C2=A0> =C2=A0> On Unix-like systems you can usually type the control characters by =C2=A0> typing Ctrl-V first: =C2=A0> =C2=A0> At the psql prompt, type =C2=A0>=C2=A0=C2=A0=C2=A0=C2=A0 select ascii(' =C2=A0> then hit V while holding the ctrl key =C2=A0> then hit C while holding the ctrl key =C2=A0> The terminal should display that as ^C =C2=A0> then complete the line with =C2=A0>=C2=A0=C2=A0=C2=A0=C2=A0 '); =C2=A0> so that it looks like =C2=A0>=C2=A0=C2=A0=C2=A0=C2=A0 select ascii('^C'); =C2=A0> and hit return: =C2=A0> =C2=A0> =C2=A0> [1] There are usually four Ctrl-Characters which need only a single =C2=A0>=C2=A0=C2=A0=C2=A0=C2=A0 key: Ctrl-I (TAB), Ctrl-M (CR), Ctrl-[ (ESC= ) and Ctrl-H (BS) or Ctrl-? =C2=A0>=C2=A0=C2=A0=C2=A0=C2=A0 (DEL). =C2=A0> =C2=A0 =C2=A0>=C2=A0=C2=A0=C2=A0=C2=A0 (On Unix systems CR is normally translated = to LF, on Windows to CRLF) =C2=A0> =C2=A0 =20 ------=_Part_2014259_682509660.1669144285436 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


=20
=20
On Tuesday, November 22, 2022 at 01:16:02 PM EST, Peter= J. Holzer <hjp-pgsql@hjp.at> wrote:

 > On 2022-11-22 17:39:04 +0000= , Alastair McKinley wrote:
 > > > \copy footable from 'inp= ut.json' (format csv, escape '^B', delimieter '^C
', quote '^E')
&nbs= p;> > >
 > > > where the control characters are t= he actual control char, not the
 > > > caret-letter, and i= t requires no escaping escapes.  I realize this
 > > >= ; won't work for all
 > > > situations.
 > >=
 > > Thanks for the suggestion, this is interesting to me to= try but I am
 > > not quite sure how this works.
 &g= t; > As far as I understand, escape/quote/delimiter have to be a single<= br> > > character, and CTRL-C etc. are multiple characters.
&= nbsp;>

Yes, Alastair, Peter said what I would have...

&nbs= p;> You may have to hit several Keys[1] on your keyboard, but Ctrl-C is = a
 > single character, just like Shift-C is (the former has code= 0003, the
 > latter 0043).
 >
 > On Unix-= like systems you can usually type the control characters by
 > t= yping Ctrl-V first:
 >
 > At the psql prompt, type >     select ascii('
 > then hit V= while holding the ctrl key
 > then hit C while holding the ctrl= key
 > The terminal should display that as ^C
 > the= n complete the line with
 >     ');
 = ;> so that it looks like
 >     select as= cii('^C');
 > and hit return:
 >
 >
&nb= sp;> [1] There are usually four Ctrl-Characters which need only a single=
 >     key: Ctrl-I (TAB), Ctrl-M (CR), Ctrl= -[ (ESC) and Ctrl-H (BS) or Ctrl-?
 >     (D= EL).
 >  
 >     (On Unix sy= stems CR is normally translated to LF, on Windows to CRLF)
 > &n= bsp;


------=_Part_2014259_682509660.1669144285436--