Re: building extension with large string inserts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tom van Tilburg <tom(dot)van(dot)tilburg(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: building extension with large string inserts
Date: 2017-07-05 15:08:16
Message-ID: 19661.1499267296@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom van Tilburg <tom(dot)van(dot)tilburg(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom van Tilburg 2017-07-05 15:17:13 Re: building extension with large string inserts
Previous Message Tom van Tilburg 2017-07-05 15:04:26 Re: building extension with large string inserts