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

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO
Date: 2022-07-28 13:04:04
Message-ID: c8b6c017-a9b5-42c9-81b1-da0afec442b3@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, all

Assertions added.

Thanks for review.

Regards,

Zhang Mingli

Sent with a Spark
On Jul 27, 2022, 14:37 +0800, Richard Guo <guofenglinux(at)gmail(dot)com>, wrote:
>
> > On Wed, Jul 27, 2022 at 12:55 PM Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> 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 like a thinko of the commit. Getting rid of the
> > > code would be good in the view of code coverage and maintenance.
> >
> > Yeah, ProcessCopyOptions() does have the check for force_notnull and
> > force_null whether it is using COPY FROM and whether it is in CSV mode.
> > So the codes in copyto.c processing force_notnull/force_null are
> > actually dead codes.
> >
> > > On the otherhand I wonder if it is good that we have assertions on the
> > > option values.
> >
> > Agree. Assertions would be better.
> >
> > Thanks
> > Richard

Attachment Content-Type Size
vn-0002-Avoid-to-handle-FORCE_NOT_NULL-FORCE_NULL-options.patch application/octet-stream 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-07-28 13:32:09 Re: Perform streaming logical transactions by background workers and parallel apply
Previous Message Simon Riggs 2022-07-28 12:47:10 Re: Hash index build performance tweak from sorting