Re: [GENERAL] building extension with large string inserts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] building extension with large string inserts
Дата
Msg-id 19243.1499266632@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [GENERAL] building extension with large string inserts  (Tom van Tilburg <tom.van.tilburg@gmail.com>)
Ответы Re: [GENERAL] building extension with large string inserts
Список pgsql-general
Tom van Tilburg <tom.van.tilburg@gmail.com> writes:
> I am trying to build an extension where there is the need to insert large
> strings consisting of javascript code.
> ...
> What would be a proper way to get this code into a table via an extension?
> I've been working on generating INSERT statements for the extension's sql
> file but it seems a tedious job to escape the code myself.

Can't you use a dollar-quoted string?  You just need to pick a delimiter
that doesn't appear anywhere in the javascript, say $JaVaScRiPt$ ...

            regards, tom lane


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] Invalid field size
Следующее
От: Tom van Tilburg
Дата:
Сообщение: Re: [GENERAL] building extension with large string inserts