Re: Add on_error and log_verbosity options to file_fdw

2024-10-03 Thread torikoshia
On 2024-10-03 18:03, Fujii Masao wrote: On 2024/10/03 13:23, Masahiko Sawada wrote: On Tue, Oct 1, 2024 at 11:34 PM Fujii Masao wrote: On 2024/10/02 9:27, Masahiko Sawada wrote: Sorry for being late in joining the review of this patch. Both 0001 and 0003 look good to me. I have two comments

Re: Add on_error and log_verbosity options to file_fdw

2024-10-03 Thread Fujii Masao
On 2024/10/03 13:23, Masahiko Sawada wrote: On Tue, Oct 1, 2024 at 11:34 PM Fujii Masao wrote: On 2024/10/02 9:27, Masahiko Sawada wrote: Sorry for being late in joining the review of this patch. Both 0001 and 0003 look good to me. I have two comments on the 0002 patch: Thanks for the

Re: Add on_error and log_verbosity options to file_fdw

2024-10-02 Thread Masahiko Sawada
On Tue, Oct 1, 2024 at 11:34 PM Fujii Masao wrote: > > > > On 2024/10/02 9:27, Masahiko Sawada wrote: > > Sorry for being late in joining the review of this patch. Both 0001 > > and 0003 look good to me. I have two comments on the 0002 patch: > > Thanks for the review! > > > I think that while sca

Re: Add on_error and log_verbosity options to file_fdw

2024-10-01 Thread Fujii Masao
\N \. +COPY check_ign_err2 FROM STDIN WITH (on_error ignore, log_verbosity silent); +3 {3} 3 'bar' +4 {4} 4 \N +\. -- reset context choice \set SHOW_CONTEXT errors -- 2.45.2 From f4458a36698997da23f813f858e6680c3e1daefa Mon Sep 17 00:00:00 2001 From: Fuji

Re: Add on_error and log_verbosity options to file_fdw

2024-10-01 Thread Masahiko Sawada
Hi, On Mon, Sep 30, 2024 at 8:36 AM Fujii Masao wrote: > > > > On 2024/09/26 21:57, torikoshia wrote: > > Updated the patches. > > Thanks for updating the patches! I’ve made some changes based on your work, > which are attached. > Barring any objections, I'm thinking to push these patches. > > F

Re: Add on_error and log_verbosity options to file_fdw

2024-09-30 Thread Fujii Masao
log_verbosity verbose); 1 {1} 1 'foo' 2 {2} 2 \N \. +COPY check_ign_err2 FROM STDIN WITH (on_error ignore, log_verbosity silent); +3 {3} 3 'bar' +4 {4} 4 \N +\. -- reset context choice \set SHOW_CONTEXT errors -

Re: Add on_error and log_verbosity options to file_fdw

2024-09-26 Thread torikoshia
4 --- a/src/test/regress/sql/copy2.sql +++ b/src/test/regress/sql/copy2.sql @@ -533,6 +533,10 @@ COPY check_ign_err2 FROM STDIN WITH (on_error ignore, log_verbosity verbose); 1 {1} 1 'foo' 2 {2} 2 \N \. +COPY check_ign_err2 FROM STDIN WITH (on_error ignore, log_verbosity silent); +3 {3} 3 &

Re: Add on_error and log_verbosity options to file_fdw

2024-09-24 Thread Fujii Masao
On 2024/09/24 20:08, torikoshia wrote: Thanks for the explanation and suggestion. Since there is almost the same code in copyfrom.c, attached 0003 patch for refactoring both. Thanks for updating the patches! Regarding 0002.patch, I think it’s better to include the refactored code from the

Re: Add on_error and log_verbosity options to file_fdw

2024-09-24 Thread torikoshia
ndex 8b14962194..fa6aa17344 100644 --- a/src/test/regress/sql/copy2.sql +++ b/src/test/regress/sql/copy2.sql @@ -533,6 +533,10 @@ COPY check_ign_err2 FROM STDIN WITH (on_error ignore, log_verbosity verbose); 1 {1} 1 'foo' 2 {2} 2 \N \. +COPY check_ign_err2 FROM STDIN WITH (on_error ignore, l

Re: Add on_error and log_verbosity options to file_fdw

2024-09-19 Thread Fujii Masao
On 2024/09/19 23:16, torikoshia wrote: -   COPY_LOG_VERBOSITY_DEFAULT = 0, /* logs no additional messages, default */ -   COPY_LOG_VERBOSITY_VERBOSE, /* logs additional messages */ +   COPY_LOG_VERBOSITY_SILENT = -1, /* logs none */ +   COPY_LOG_VERBOSITY_DEFAULT = 0, /* logs

Re: Add on_error and log_verbosity options to file_fdw

2024-09-19 Thread torikoshia
l/copy2.sql @@ -533,6 +533,10 @@ COPY check_ign_err2 FROM STDIN WITH (on_error ignore, log_verbosity verbose); 1 {1} 1 'foo' 2 {2} 2 \N \. +COPY check_ign_err2 FROM STDIN WITH (on_error ignore, log_verbosity silent); +3 {3} 3 'bar' +4 {4} 4 \N +\. -- reset context choice \set SHOW_CONTEXT

Re: Add on_error and log_verbosity options to file_fdw

2024-09-11 Thread Fujii Masao
On 2024/08/08 16:36, torikoshia wrote: Attached patches. 0001 adds new option 'silent' to log_verbosity and 0002 adds on_error and log_verbosity options to file_fdw. Thanks for the patches! Here are the review comments for 0001 patch. + silent excludes verbose messages. This should

Re: Add on_error and log_verbosity options to file_fdw

2024-08-08 Thread torikoshia
27; 2 {2} 2 \N \. +COPY check_ign_err2 FROM STDIN WITH (on_error ignore, log_verbosity silent); +3 {3} 3 'bar' +4 {4} 4 \N +\. -- reset context choice \set SHOW_CONTEXT errors -- 2.39.2 From e950fe58bd043f8e378ff6d75773bb52855504f4 Mon Sep 17 00:00:00 2001 From: Atsushi Torikoshi

Re: Add on_error and log_verbosity options to file_fdw

2024-07-24 Thread torikoshia
On 2024-07-23 08:57, Michael Paquier wrote: On Mon, Jul 22, 2024 at 03:07:46PM -0700, Masahiko Sawada wrote: I'm slightly concerned that users might not want to see the NOTICE message for every scan. Unlike COPY FROM, scanning a file via file_fdw could be frequent. Agreed. Yeah, I also have

Re: Add on_error and log_verbosity options to file_fdw

2024-07-22 Thread Michael Paquier
On Mon, Jul 22, 2024 at 03:07:46PM -0700, Masahiko Sawada wrote: > I'm slightly concerned that users might not want to see the NOTICE > message for every scan. Unlike COPY FROM, scanning a file via file_fdw > could be frequent. An alternative idea of place to write the > information of the number o

Re: Add on_error and log_verbosity options to file_fdw

2024-07-22 Thread Masahiko Sawada
Hi, On Thu, Jul 18, 2024 at 6:38 PM torikoshia wrote: > > On 2024-07-05 00:27, torikoshia wrote: > > Hi, > > > > With the current file_fdw, if even one line of data conversion fails, > > the contents of the file cannot be referenced at all: > > > > =# \! cat data/test.data > > 1,a > > 2,b >

Re: Add on_error and log_verbosity options to file_fdw

2024-07-18 Thread torikoshia
stgresql.org/docs/devel/sql-copy.html [2] https://x.com/fujii_masao/status/1808178032219509041 Update the patch since v1 patch caused compiler warning. -- Regards, -- Atsushi Torikoshi NTT DATA Group CorporationFrom b6295590977479ffb601c9848c6194a51d75e932 Mon Sep 17 00:00:00 2001 From: Atsushi To

Add on_error and log_verbosity options to file_fdw

2024-07-04 Thread torikoshia
Hi, With the current file_fdw, if even one line of data conversion fails, the contents of the file cannot be referenced at all: =# \! cat data/test.data 1,a 2,b a,c =# create foreign table f_fdw_test_1 (i int, t text) server f_fdw options (filename 'test.data', format 'csv'); CRE