Search Postgresql Archives

Re: building extension with large string inserts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 5, 2017 at 8:04 AM, Tom van Tilburg <tom.van.tilburg@xxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux