Re: copying json data and backslashes

Поиск
Список
Период
Сортировка
От pbj@cmicdo.com
Тема Re: copying json data and backslashes
Дата
Msg-id 329136653.2014260.1669144285438@mail.yahoo.com
обсуждение исходный текст
Ответ на Re: copying json data and backslashes  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Ответы Re: copying json data and backslashes  (Erik Wienhold <ewie@ewie.name>)
Список pgsql-general


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 'input.json' (format csv, escape '^B', delimieter '^C
', quote '^E')
 > > >
 > > > where the control characters are the actual control char, not the
 > > > caret-letter, and it 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.
 > > As far as I understand, escape/quote/delimiter have to be a single
 > > character, and CTRL-C etc. are multiple characters.
 >

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

 > 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
 > typing 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
 > then complete the line with
 >     ');
 > so that it looks like
 >     select ascii('^C');
 > and hit return:
 >
 >
 > [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-?
 >     (DEL).
 >  
 >     (On Unix systems CR is normally translated to LF, on Windows to CRLF)
 >  


В списке pgsql-general по дате отправления:

Предыдущее
От: Ted Toth
Дата:
Сообщение: security label and indexes
Следующее
От: Erik Wienhold
Дата:
Сообщение: Re: copying json data and backslashes