Search Postgresql Archives

Re: building extension with large string inserts

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

 



You are right! I totally forgot about this dollar quoting :)
Typically one of those things you will only remember the hard way ;-)

Thanks a lot,
 Tom

On Wed, Jul 5, 2017 at 5:08 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
Tom van Tilburg <tom.van.tilburg@xxxxxxxxx> writes:
> 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. $);

Sure, but in a dollar-quoted literal you don't need to escape them.

https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING

> and: Am I correct that INSERTS are the way to go in extensions?

Seems reasonable, if you want the extension script to be self-contained.

                        regards, tom lane


[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