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

From Pavel Stehule
Subject Re: raw output from copy
Date
Msg-id CAFj8pRBMaKX1eoOcnLP8d6HerOfybX4cfRy-+mDWXmu-OKwbrw@mail.gmail.com
Whole thread Raw
In response to Re: raw output from copy  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: raw output from copy  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
<p dir="ltr">Hi,<p dir="ltr">Psql based implementation needs new infrastructure (more than few lines)<p
dir="ltr">Missing:<pdir="ltr">* binary mode support<br /> * parametrized query support,<p dir="ltr">I am not against,
butboth points I proposed, and both was rejected.<p dir="ltr">So why dont use current infrastructure? Raw copy is
trivialpatch.<div class="gmail_quote">Dne 6.8.2015 0:09 napsal uživatel "Andrew Dunstan" <<a
href="mailto:andrew@dunslane.net">andrew@dunslane.net</a>>:<brtype="attribution" /><blockquote class="gmail_quote"
style="margin:00 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br /> On 08/05/2015 04:59 PM, Heikki Linnakangas
wrote:<br/><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> On
07/27/201502:28 PM, Pavel Stehule wrote:<br /><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px
#cccsolid;padding-left:1ex"> 2015-07-27 10:41 GMT+02:00 Heikki Linnakangas <<a href="mailto:hlinnaka@iki.fi"
target="_blank">hlinnaka@iki.fi</a>>:<br/><br /><blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px#ccc solid;padding-left:1ex"> What about input? This is a whole new feature, but it would be nice
tobe<br /> able to pass the file contents as a query parameter. Something like:<br /><br /> \P /tmp/foo binary<br />
INSERTINTO foo VALUES (?);<br /></blockquote><br /> The example of input is strong reason, why don't do it via inserts.
Only<br/> parsing some special "?" symbol needs lot of new code.<br /></blockquote><br /> 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
thisnew mechanism.<br /><br /><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">In this case, I don't see any advantage of  psql based solution. COPY is<br /> standard
interfacefor input/output from/to files, and it should be used<br /> there.<br /></blockquote><br /> I'm not too happy
withthe COPY approach, although I won't object is one of the other committers feel more comfortable with it. However,
wedon't seem to be making progress here, so I'm going to mark this as Returned with Feedback. I don't feel good about
thateither, because I don't actually have any great suggestions on how to move this forward. Which is a pity because
thisis a genuine problem for users.<br /><br /><br /></blockquote><br /> This is really only a psql problem, IMNSHO.
Insertingand extracting binary data is pretty trivial for most users of client libraries (e.g. it's a couple of lines
ofcode in a DBD::Pg program), but it's hard in psql.<br /><br /> I do agree that the COPY approach feels more than a
littleklunky.<br /><br /> cheers<br /><br /> andrew<br /><br /><br /></blockquote></div> 

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Raising our compiler requirements for 9.6
Next
From: Ildus Kurbangaliev
Date:
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive