Re: Review : Add hooks for pre- and post-processor executables for COPY and \copy - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: Review : Add hooks for pre- and post-processor executables for COPY and \copy
Date
Msg-id 00c801cdf961$fd888920$f8999b60$@lab.ntt.co.jp
Whole thread Raw
In response to Review : Add hooks for pre- and post-processor executables for COPY and \copy  (Amit Kapila <amit.kapila@huawei.com>)
Responses Re: Review : Add hooks for pre- and post-processor executables for COPY and \copy
List 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

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Request for vote to move forward with recovery.conf overhaul
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: fix corner use case of variadic fuctions usage