Re: cataloguing NOT NULL constraints - Mailing list pgsql-hackers

From Zhihong Yu
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id CALNJ-vTdsYpb_21K9NhbFe4Y+oCfvRebm46aBHw3ktpZ9PcHdQ@mail.gmail.com
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Zhihong Yu <zyu@yugabyte.com>)
List pgsql-hackers
Hi,
w.r.t. the while loop in findNotNullConstraintAttnum():

+       if (multiple == NULL)
+           break;

I think `pfree(arr)` should be called before breaking.

+       if (constraint->cooked_expr != NULL)
+           return tryExtractNotNullFromNode(stringToNode(constraint->cooked_expr), rel);
+       else
+           return tryExtractNotNullFromNode(constraint->raw_expr, rel);

nit: the `else` keyword is not needed.

+   if (isnull)
+       elog(ERROR, "null conbin for constraint %u", conForm->oid);

It would be better to expand `conbin` so that the user can better understand the error.

Cheers

pgsql-hackers by date:

Previous
From: Melih Mutlu
Date:
Subject: Re: Summary function for pg_buffercache
Next
From: andrey.arapov@nixaid.com
Date:
Subject: [PATCH] initdb: do not exit after warn_on_mount_point