Re: [GENERAL] building extension with large string inserts

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [GENERAL] building extension with large string inserts
Дата
Msg-id CAKFQuwY-qcq9L_r4Ww5hLM2jpxsZi4WOcqKYi31umB_hMw3DmQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] building extension with large string inserts  (Tom van Tilburg <tom.van.tilburg@gmail.com>)
Список pgsql-general
On Wed, Jul 5, 2017 at 8:04 AM, Tom van Tilburg <tom.van.tilburg@gmail.com> wrote:
I think I misunderstand. How would that help my insert statement? 
You would get INSERT INTO mytable VALUES ($ javascript with a lot of unescaped characters like /n " // etc. $);

​Tom Lane provided the relevant syntax link, though if you supply an actual, shortened, example someone might show exactly what this all means for you - or how you'd need to tweak your text to make it work.

$$ { "key1": "value"​,
       "key2": "value" } $$

Will be inserted as-is, explicit newlines and all.  Likewise,

$$ { "key1": "value", \n "key2": "value" } $$

will be inserted without any newlines and with a literal "\n" in the middle of the text.

Unlike single-quote literals there is no alternate "E" form of dollar-quoting that will cause the \n to be interpreted as a newline.  In practice its absence doesn't seem missed.

David J.

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

Предыдущее
От: Hans Schou
Дата:
Сообщение: Re: [GENERAL] Feature proposal, DBURL: psql pgsql://joe:p4zzw0rd@example.org:2345/dbname
Следующее
От: Hans Schou
Дата:
Сообщение: Re: [GENERAL] Re: Feature proposal, DBURL: psql pgsql://joe:p4zzw0rd@example.org:2345/dbname