On Wed, Jul 5, 2017 at 8:04 AM, Tom van Tilburg
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
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 wrote:
> Tom van Tilburg writes:
> > I think I
Tom van Tilburg 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
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. $);
and: Am I correct that INSERTS are the way to go in extensions?
Best,
Tom vT.
On Wed, Jul 5, 2017 at 4:57 PM, Tom
Tom van Tilburg 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
I am trying to build an extension where there is the need to insert large
strings consisting of javascript code. The easiest way to get these string
currently into a table is by using
\set varname `cat mycode.js`
INSERT INTO mytable VALUES (:'varname');
and run this from the psql client.
psql