Re: COPY table FROM STDIN doesn't show count tag - Mailing list pgsql-hackers

From Amit Khandekar
Subject Re: COPY table FROM STDIN doesn't show count tag
Date
Msg-id CACoZds0MVO_1d7rWZTqpWLFKS=SCXTVwtB_yxdrBWsPaL50ySA@mail.gmail.com
Whole thread Raw
In response to Re: COPY table FROM STDIN doesn't show count tag  (Rajeev rastogi <rajeev.rastogi@huawei.com>)
List pgsql-hackers



On 29 November 2013 19:20, Rajeev rastogi <rajeev.rastogi@huawei.com> wrote:

On 26 November 2013, Amit Khandelkar wrote:

>Can you please submit the \COPY patch as a separate patch ? Since these are two different issues, I would like to have these two fixed and committed separately. You can always test the \COPY issue using \COPY TO followed by INSERT.

 

Please find the attached two separate patches:


Thanks. 

 

1.      slashcopyissuev1.patch :- This patch fixes the \COPY issue.

You have removed the if condition in this statement, mentioning that it is always true now:
-                       if (copystream == pset.cur_cmd_source)
-                               pset.lineno++;
+                       pset.lineno++;

 But copystream can be different than pset.cur_cmd_source , right ?


+       FILE       *copyStream;         /* Stream to read/write for copy command */

There is no tab between FILE and *copystream, hence it is not aligned.


2.      initialcopyissuev1_ontopofslashcopy.patch : Fix for “COPY table FROM STDIN/STDOUT doesn't show count tag”.


The following header comments of ProcessResult() need to be modified:
* Changes its argument to point to the last PGresult of the command string,
* or NULL if that result was for a COPY FROM STDIN or COPY TO STDOUT.


Regression results show all passed. 

Other than this, the patch needs a new regression test.

I don't think we need to do any doc changes, because the doc already mentions that COPY should show the COUNT tag, and does not mention anything specific to client-side COPY.
 

 

Thanks and Regards,

Kumar Rajeev Rastogi

 

 


pgsql-hackers by date:

Previous
From: "Etsuro Fujita"
Date:
Subject: Re: Show lossy heap block info in EXPLAIN ANALYZE for bitmap heap scan
Next
From: Karsten Hilbert
Date:
Subject: Re: [GENERAL] pg_upgrade ?deficiency