Re: raw output from copy - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: raw output from copy
Date
Msg-id 55C27933.9030506@iki.fi
Whole thread Raw
In response to Re: raw output from copy  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: raw output from copy  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 07/27/2015 02:28 PM, Pavel Stehule wrote:
> 2015-07-27 10:41 GMT+02:00 Heikki Linnakangas <hlinnaka@iki.fi>:
>
>> What about input? This is a whole new feature, but it would be nice to be
>> able to pass the file contents as a query parameter. Something like:
>>
>> \P /tmp/foo binary
>> INSERT INTO foo VALUES (?);
>
> The example of input is strong reason, why don't do it via inserts. Only
> parsing some special "?" symbol needs lot of new code.

Sorry, I meant $1 in place of the ?. No special parsing needed, psql can 
send the query to the server as is, with the parameters that are given 
by this new mechanism.

> In this case, I don't see any advantage of  psql based solution. COPY is
> standard interface for input/output from/to files, and it should be used
> there.

I'm not too happy with the COPY approach, although I won't object is one 
of the other committers feel more comfortable with it. However, we don't 
seem to be making progress here, so I'm going to mark this as Returned 
with Feedback. I don't feel good about that either, because I don't 
actually have any great suggestions on how to move this forward. Which 
is a pity because this is a genuine problem for users.

- Heikki




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: pgbench - allow backslash-continuations in custom scripts
Next
From: Andrew Dunstan
Date:
Subject: Re: raw output from copy