Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-11-01 Thread Michael Paquier
On Tue, Nov 01, 2022 at 05:51:42PM +0800, Richard Guo wrote: > I'm OK with not having these assertions. I have to admit they look > somewhat redundant here, after what ProcessCopyOptions has done. Thanks, and done. While on it, I have noticed some gaps with the coverage of the code, where we did

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-11-01 Thread Mingli Zhang
Hi, > > The point about cleaning up the attribute handling of FORCE_NOT_NULL > and FORCE_NULL in the COPY TO path is a good catch, though, so let's > remove all that. I'll go apply this part of the patch in a bit, or > tomorrow. > -- > Michael Thanks for review!

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-11-01 Thread Richard Guo
On Tue, Nov 1, 2022 at 3:41 PM Michael Paquier wrote: > On Tue, Aug 02, 2022 at 04:13:30PM +0800, Zhang Mingli wrote: > > On Aug 2, 2022, 12:30 +0800, Kyotaro Horiguchi , > wrote: > >> There are some other option combinations that are rejected > >> by ProcessCopyOptions. On the other hand *re*che

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-11-01 Thread Michael Paquier
On Tue, Aug 02, 2022 at 04:13:30PM +0800, Zhang Mingli wrote: > On Aug 2, 2022, 12:30 +0800, Kyotaro Horiguchi , > wrote: >> There are some other option combinations that are rejected >> by ProcessCopyOptions. On the other hand *re*checking all >> combinations that the function should have rejecte

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-08-02 Thread Zhang Mingli
Regards, Zhang Mingli On Aug 2, 2022, 12:30 +0800, Kyotaro Horiguchi , wrote: > An empty List is not NULL but NIL (which values are identical, > though). Thanks for pointing that out. Fix it in new patch. > There are some other option combinations that are rejected > by ProcessCopyOptions. On the

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-08-01 Thread Kyotaro Horiguchi
At Mon, 1 Aug 2022 09:59:49 +0800, Zhang Mingli wrote in > On Jul 29, 2022, 11:24 +0800, Richard Guo , wrote: > > > > > On Thu, Jul 28, 2022 at 9:04 PM Zhang Mingli > > > wrote: > > > > Assertions added. > > > > > > Can we also add assertions to make sure force_quote, force_notnull and > > > f

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-31 Thread Zhang Mingli
HI, More assertions added. Thanks. Regards, Zhang Mingli On Jul 29, 2022, 11:24 +0800, Richard Guo , wrote: > > > On Thu, Jul 28, 2022 at 9:04 PM Zhang Mingli wrote: > > > Assertions added. > > > > Can we also add assertions to make sure force_quote, force_notnull and > > force_null are availab

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-28 Thread Richard Guo
On Thu, Jul 28, 2022 at 9:04 PM Zhang Mingli wrote: > Assertions added. > Can we also add assertions to make sure force_quote, force_notnull and force_null are available only in CSV mode? Thanks Richard

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-28 Thread Zhang Mingli
Hi, all Assertions added. Thanks for review. Regards, Zhang Mingli Sent with a Spark On Jul 27, 2022, 14:37 +0800, Richard Guo , wrote: > > > On Wed, Jul 27, 2022 at 12:55 PM Kyotaro Horiguchi > > wrote: > > > ProcessCopyOptions previously rejects force_quote_all for COPY FROM > > > and copy

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-26 Thread Richard Guo
On Wed, Jul 27, 2022 at 12:55 PM Kyotaro Horiguchi wrote: > ProcessCopyOptions previously rejects force_quote_all for COPY FROM > and copyfrom.c is not even conscious of the option (that is, even no > assertion on it). The two options are rejected for COPY TO by the same > function so it seems li

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-26 Thread Kyotaro Horiguchi
At Wed, 27 Jul 2022 00:16:33 +0800, Zhang Mingli wrote in > FORCE_NOT_NULL and FORCE_NULL are only used when COPY FROM. > > And copyto.c and copyfrom.c are split in this commit > https://github.com/postgres/postgres//commit/c532d15dddff14b01fe9ef1d465013cb8ef186df > >