pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Voillequin, Jean-Marc <Jean-Marc.Voillequin@moodys.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #15535: psql: \copy: parse error at...
Date: Wed, 05 Dec 2018 12:32:55 -0500
Message-ID: <6309.1544031175@sss.pgh.pa.us> (raw)
In-Reply-To: <8116df5b-46d4-4099-b334-bd727e337044@manitou-mail.org>
References: <8116df5b-46d4-4099-b334-bd727e337044@manitou-mail.org>

"Daniel Verite" <daniel@manitou-mail.org> writes:
> Tom Lane wrote:
>> There was a proposal awhile back to provide a variant of \copy
>> that works more like \g, so you'd enter something like
>> 
>> COPY (SELECT ...) TO STDOUT
>> \copyto somefile
>> 
>> which'd be way more flexible --- the COPY command wouldn't have to
>> fit on one line, for one thing.  But I don't think that's gone
>> anywhere yet.

> That would be the proof-of-concept patch posted a few weeks ago here:
> https://www.postgresql.org/message-id/15dadc39-e050-4d46-956b-dcc4ed098753@manitou-mail.org

> There didn't seem to be much of community buy-in for this idea, so I've it
> let rest
> for the moment. On one hand, it solves actual problems such as the one
> mentioned in this bug report, on the other hand I can feel the discomfort
> of having 3 forms of \copy, in addition to COPY, and that maybe it would
> create more confusion than benefits, overall.

Yeah, that is an issue all right.  It occurs to me that for the COPY TO
side, we don't really need any new command: we could just make \g work
for that case.  (Testing, it seems that plain "\g" works fine already,
but "\g foo" fails to redirect the COPY output, which seems to me to
be arguably a bug as well as lack of useful functionality.)

That approach does nothing for COPY FROM, though.  On the other hand,
it's not needed nearly as bad for COPY FROM, since you can't put a
giant sub-SELECT into that.

			regards, tom lane




view thread (10+ messages)  latest in thread

Message-ID: <6309.1544031175@sss.pgh.pa.us>
Permalink:  ../6309.1544031175@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6309.1544031175@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, daniel@manitou-mail.org, david.g.johnston@gmail.com, Jean-Marc.Voillequin@moodys.com
  Subject: Re: BUG #15535: psql: \copy: parse error at...
  In-Reply-To: <6309.1544031175@sss.pgh.pa.us>
  References: <8116df5b-46d4-4099-b334-bd727e337044@manitou-mail.org> <6309.1544031175@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox