Re: Review : Add hooks for pre- and post-processor executables for COPY and \copy

From: "Etsuro Fujita" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: "'Amit Kapila'" <amit(dot)kapila(at)huawei(dot)com>, "'pgsql-hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Review : Add hooks for pre- and post-processor executables for COPY and \copy
Date: 2013-01-23 12:05:52
Message-ID: 00c801cdf961$fd888920$f8999b60$@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Amit,

Thank you for your review. I've rebased and updated the patch. Please find
attached the patch.

> Code Review comments:
> ---------------------
>
> 1. Modify the comment in function header of: parse_slash_copy (needs to modify
for new syntax)

Done.

> 2. Comments for functions OpenPipeStream & ClosePipeStream are missing.

Done.

> 3. Any Script errors are not directly visible to user; If there problems in
script no way to cleanup.

> Shouldn't this be mentioned in User Manual.

Done. Please see the documentation note on the \copy instruction in
psql-ref.sgml.

> Test case issues:
> ------------------
> 1. "Broken pipe" is not handled in case of psql "\copy" command;
> Issue are as follows:
> Following are verified on SuSE-Linux 10.2.
> 1) psql is exiting when "\COPY xxx TO" command is issued and
command/script is not found

> When popen is called in write mode it is creating valid file
descriptor and when it tries to write to file "Broken pipe" error is > coming
which is not handled.
> psql# \copy pgbench_accounts TO PROGRAM
'../compress.sh pgbench_accounts4.txt'
> 2) When "\copy" command is in progress then program/command is
killed/"crashed due to any problem"
> psql is exiting.

This is a headache. I have no idea how to solve this.

Sorry for the long delay in responding.

Best regards,

Etsuro Fujita

Attachment Content-Type Size
copy-popen-20130123.patch application/octet-stream 32.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-01-23 12:13:18 Re: proposal: fix corner use case of variadic fuctions usage
Previous Message Michael Paquier 2013-01-23 11:36:16 Re: Request for vote to move forward with recovery.conf overhaul