Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-09-30 Thread Andrew Dunstan
On 2023-07-31 Mo 20:46, Zhang Mingli wrote: On Aug 1, 2023, at 03:35, Andrew Dunstan wrote: I was hoping it be able to get to it today but that's not happening. If you want to submit a revised patch as above that will be good. I hope to get to it later this week. HI, Andrew Patch

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-31 Thread Zhang Mingli
On Aug 1, 2023, at 03:35, Andrew Dunstan wrote:I was hoping it be able to get to it today but that's not happening. If you want to submit a revised patch as above that will be good. I hope to get to it later this week.HI, Andrew Patch rebased and updated like above, thanks.

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-31 Thread Andrew Dunstan
On 2023-07-26 We 03:03, Zhang Mingli wrote: HI, I've looked at this patch and it looks mostly fine, though I do not intend to commit it myself; perhaps Andrew will. HI, Amit, thanks for review. A few minor things to improve: +  If * is specified, it will be applied in all columns.

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-26 Thread Zhang Mingli
HI, > I've looked at this patch and it looks mostly fine, though I do not > intend to commit it myself; perhaps Andrew will. HI, Amit, thanks for review. > > A few minor things to improve: > > + If * is specified, it will be applied in all > columns. > ... > + If * is specified, it

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-26 Thread Amit Langote
Hello, On Thu, Jul 20, 2023 at 4:06 PM Zhang Mingli wrote: > > Hi, > > On Jul 7, 2023 at 18:00 +0800, Damir Belyalov , wrote: > > > V2 patch still have some errors when apply file doc/src/sgml/ref/copy.sgml, > rebased and fixed it in V3 path. > Thanks a lot for review. > > I have updated

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-20 Thread Zhang Mingli
Hi, On Jul 7, 2023 at 18:00 +0800, Damir Belyalov , wrote: > > V2 patch still have some errors when apply file doc/src/sgml/ref/copy.sgml, > rebased and fixed it in V3 path. > Thanks a lot for review. I have updated https://commitfest.postgresql.org/43/3896/ to staus Ready for Committer, thanks

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-18 Thread Zhang Mingli
Hi, On Jul 9, 2023 at 11:51 +0800, Zhang Mingli , wrote: HI, Regards, Zhang Mingli On Jul 7, 2023, 18:00 +0800, Damir Belyalov , wrote: The patch does not work for the current version of postgres, it needs to be updated. I tested your patch. Everything looks simple and works well.

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-08 Thread Zhang Mingli
HI, Regards, Zhang Mingli On Jul 7, 2023, 18:00 +0800, Damir Belyalov , wrote: > > The patch does not work for the current version of postgres, it needs to be > updated. > I tested your patch. Everything looks simple and works well. > > There is a suggestion to simplify the code: instead of

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-07 Thread Damir Belyalov
Hello! The patch does not work for the current version of postgres, it needs to be updated. I tested your patch. Everything looks simple and works well. There is a suggestion to simplify the code: instead of using if (cstate->opts.force_notnull_all) { int i; for(i = 0; i < num_phys_attrs; i++)

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-01-13 Thread Zhang Mingli
HI, On Dec 27, 2022, 19:02 +0800, Melih Mutlu , wrote: Hi, Having  FORCE_NULL(*) and FORCE_NOT_NULL(*) sounds good, since postgres already has FORCE_QUOTE(*). I just quickly tried out your patch. It worked for me as expected.  One little suggestion: + if

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2022-12-27 Thread Melih Mutlu
Hi, Having FORCE_NULL(*) and FORCE_NOT_NULL(*) sounds good, since postgres already has FORCE_QUOTE(*). I just quickly tried out your patch. It worked for me as expected. One little suggestion: + if (cstate->opts.force_notnull_all) > + { > + int i; > + for(i = 0; i < num_phys_attrs;

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2022-08-01 Thread Andrew Dunstan
On 2022-08-01 Mo 15:50, Andrew Dunstan wrote: > On 2022-08-01 Mo 09:56, Zhang Mingli wrote: >> Hi,  >> >> The previous discussion is: >> >> https://www.postgresql.org/message-id/CACJufxEnVqzOFtqhexF2%2BAwOKFrV8zHOY3y%3Dp%2BgPK6eB14pn_w%40mail.gmail.com > > Starting a new thread is pointless and

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2022-08-01 Thread Andrew Dunstan
On 2022-08-01 Mo 09:56, Zhang Mingli wrote: > Hi,  > > The previous discussion is: > > https://www.postgresql.org/message-id/CACJufxEnVqzOFtqhexF2%2BAwOKFrV8zHOY3y%3Dp%2BgPK6eB14pn_w%40mail.gmail.com Starting a new thread is pointless and annoying. As I said in the previous thread, we would

[feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2022-08-01 Thread Zhang Mingli
Hi, The previous discussion is: https://www.postgresql.org/message-id/CACJufxEnVqzOFtqhexF2%2BAwOKFrV8zHOY3y%3Dp%2BgPK6eB14pn_w%40mail.gmail.com We  have FORCE_NULL/FORCE_NOT_NULL options when COPY FROM,  but users must set the columns one by one.  CREATE TABLE forcetest (  a INT NOT NULL,