Re: COPY table FROM STDIN doesn't show count tag

Lists: pgsql-hackers
From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Amit Khandekar <amit(dot)khandekar(at)enterprisedb(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY table FROM STDIN doesn't show count tag
Date: 2013-11-29 13:50:27
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDAF58F@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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:

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

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

Thanks and Regards,
Kumar Rajeev Rastogi

Attachment Content-Type Size
slashcopyissuev1.patch application/octet-stream 3.8 KB
initialcopyissuev1_ontopofslashcopy.patch application/octet-stream 5.4 KB

From: Amit Khandekar <amit(dot)khandekar(at)enterprisedb(dot)com>
To: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY table FROM STDIN doesn't show count tag
Date: 2013-12-09 06:57:27
Message-ID: CACoZds0MVO_1d7rWZTqpWLFKS=SCXTVwtB_yxdrBWsPaL50ySA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 29 November 2013 19:20, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)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
>
>
>
>
>