On Fri, May 27, 2016 at 11:36 AM, Corey Huinker wrote:
>>
>> For the following pretend that "STRING" has the same behavior as the
>> "format(...)" function.
>>
>> EXECUTE STRING('COPY %I TO %L', 'testtable', 'testfile.txt');
>
> +1
-1
Why use syntax to do this? If we need a function with specia
>
>
> For the following pretend that "STRING" has the same behavior as the
> "format(...)" function.
>
> EXECUTE STRING('COPY %I TO %L', 'testtable', 'testfile.txt');
>
+1
We should make string sanitization easy so that people use it by default.
In the mean time, if you're just using psql, the n
On Fri, May 27, 2016 at 6:02 AM, Craig Ringer wrote:
>
> COPY FROM $1 TO 'myfilename'
>
>
Random thought - how about at least making the following work:
For the following pretend that "STRING" has the same behavior as the
"format(...)" function.
EXECUTE STRING('COPY %I TO %L', 'testtable',
On 27 May 2016 at 15:17, Andrew Gierth wrote:
> > "Merlin" == Merlin Moncure writes:
>
> Merlin> Note, the biggest pain point I have with COPY is not being able
> Merlin> to parameterize the filename argument.
>
> Second proof of concept attached. This goes so far as to allow
> statements
> "Merlin" == Merlin Moncure writes:
Merlin> Note, the biggest pain point I have with COPY is not being able
Merlin> to parameterize the filename argument.
Second proof of concept attached. This goes so far as to allow
statements like:
do $$
declare t text := 'bar'; f text := '/tmp/copy
> "Merlin" == Merlin Moncure writes:
Merlin> Hm, what's the use case preparing COPY?
Preparing it isn't necessarily the point (and SQL-level PREPARE is not
addressed in that patch). The point is to allow parameters, so that a
client can do
COPY (select blah from whatever where thing = $1)
Merlin Moncure writes:
> Hm, what's the use case preparing COPY? Note, the biggest pain point
> I have with COPY is not being able to parameterize the filename
> argument.
Yeah. But putting a parameter symbol there (or anywhere in a utility
statement that's not part of an analyzable subexpressi
On Tue, May 24, 2016 at 3:42 PM, David Fetter wrote:
> On Tue, May 24, 2016 at 02:16:40PM -0400, Tom Lane wrote:
>> David Fetter writes:
>> > Per discussion on IRC and some test code, COPY can't take parameters
>> > in a PREPARE, which feature would make it even more useful.
>>
>> Uh, what?
>>
>>
On Tue, May 24, 2016 at 02:16:40PM -0400, Tom Lane wrote:
> David Fetter writes:
> > Per discussion on IRC and some test code, COPY can't take parameters
> > in a PREPARE, which feature would make it even more useful.
>
> Uh, what?
>
> regression=# prepare foo as copy c from stdin;
> ERROR: syn
David Fetter writes:
> Per discussion on IRC and some test code, COPY can't take parameters
> in a PREPARE, which feature would make it even more useful.
Uh, what?
regression=# prepare foo as copy c from stdin;
ERROR: syntax error at or near "copy"
LINE 1: prepare foo as copy c from stdin;
10 matches
Mail list logo