Re: Added tab completion for the missing options in copy statement

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Ahsan Hadi <ahsan(dot)hadi(at)gmail(dot)com>
Subject: Re: Added tab completion for the missing options in copy statement
Date: 2020-07-18 11:06:20
Message-ID: 20200718110620.GA30069@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 18, 2020 at 04:12:02PM +0530, vignesh C wrote:
> Can we specify Insert/Update or delete with copy?
> When I tried few scenarios I was getting the following error:
> ERROR: COPY query must have a RETURNING clause
>
> I might be missing some scenarios, just wanted to confirm if this is
> kept intentionally.

This error message says it all, this is supported for a DML that
includes a RETURNING clause:
=# create table aa (a int);
CREATE TABLE
=# copy (insert into aa values (generate_series(2,5)) returning a)
to '/tmp/data.txt';
COPY 4
=# \! cat /tmp/data.txt
2
3
4
5

Thanks,
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2020-07-18 11:18:43 Patch for nodeIncrementalSort comment correction.
Previous Message Amit Kapila 2020-07-18 11:03:34 Re: Transactions involving multiple postgres foreign servers, take 2