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

From: Damir Belyalov <dam(dot)bel07(at)gmail(dot)com>
To: Zhang Mingli <zmlpostgres(at)gmail(dot)com>, "andrew(at)dunslane(dot)net" <andrew(at)dunslane(dot)net>
Cc: Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns
Date: 2023-07-07 10:00:27
Message-ID: CALH1LgurdKw6H0mDDLopX2eymyEW7EwZfsbAT6909JQ2Daf3Lw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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++)
cstate->opt.force_notnull_flags[i] = true;
}

you can use MemSet():

if (cstate->opts.force_notnull_all)
MemSet(cstate->opt.force_notnull_flags, true, num_phys_attrs *
sizeof(bool));

The same for the force_null case.

Regards,
Damir Belyalov,
Postgres Professional

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-07-07 10:18:04 Re: Disabling Heap-Only Tuples
Previous Message Matthias van de Meent 2023-07-07 09:55:28 Re: Disabling Heap-Only Tuples