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 13:12:37 -0500
Message-ID: <7732.1544033557@sss.pgh.pa.us> (raw)
In-Reply-To: <05a4c411-66fa-4bd0-bf80-98041a87c8de@manitou-mail.org>
References: <05a4c411-66fa-4bd0-bf80-98041a87c8de@manitou-mail.org>

"Daniel Verite" <daniel@manitou-mail.org> writes:
> Tom Lane wrote:
>> 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.

> Agreed. I will look into the problem of COPY OUT with \g filename
> if you don't beat me to it.

I wasn't volunteering to work on that, so have at it.

> Concerning \copyfrom, the most obvious use case is when the filename
> has to be a variable, which \copy doesn't allow for.
> But this one might be better solved by just improving \copy.

I wonder ... would it be outrageous for "\g foo" to be interpreted
as reading foo, not writing it, if what comes back from the server
is a CopyInResponse message rather than a query result or
CopyOutResponse?

No new commands that way, but maybe more potential for user confusion,
so I'm not sure if this is a good idea or not.

			regards, tom lane




view thread (10+ messages)

Message-ID: <7732.1544033557@sss.pgh.pa.us>
Permalink:  ../7732.1544033557@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7732.1544033557@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: <7732.1544033557@sss.pgh.pa.us>
  References: <05a4c411-66fa-4bd0-bf80-98041a87c8de@manitou-mail.org> <7732.1544033557@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