From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | hlinnaka <hlinnaka(at)iki(dot)fi>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Golub <pavel(at)microolap(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com> |
Subject: | Re: raw output from copy |
Date: | 2015-08-06 08:37:32 |
Message-ID: | CAFj8pRBMaKX1eoOcnLP8d6HerOfybX4cfRy-+mDWXmu-OKwbrw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
Psql based implementation needs new infrastructure (more than few lines)
Missing:
* binary mode support
* parametrized query support,
I am not against, but both points I proposed, and both was rejected.
So why dont use current infrastructure? Raw copy is trivial patch.
Dne 6.8.2015 0:09 napsal uživatel "Andrew Dunstan" <andrew(at)dunslane(dot)net>:
>
> On 08/05/2015 04:59 PM, Heikki Linnakangas wrote:
>
>> On 07/27/2015 02:28 PM, Pavel Stehule wrote:
>>
>>> 2015-07-27 10:41 GMT+02:00 Heikki Linnakangas <hlinnaka(at)iki(dot)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.
>>
>>
>>
> This is really only a psql problem, IMNSHO. Inserting and extracting
> binary data is pretty trivial for most users of client libraries (e.g. it's
> a couple of lines of code in a DBD::Pg program), but it's hard in psql.
>
> I do agree that the COPY approach feels more than a little klunky.
>
> cheers
>
> andrew
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Ildus Kurbangaliev | 2015-08-06 10:01:15 | Re: RFC: replace pg_stat_activity.waiting with something more descriptive |
Previous Message | Andres Freund | 2015-08-06 07:09:02 | Re: Raising our compiler requirements for 9.6 |