Re: not null constraints, again

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tender Wang <tndrwang(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, jian he <jian(dot)universality(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: not null constraints, again
Date: 2025-04-16 12:24:18
Message-ID: 202504161224.xedjghsndf7w@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Apr-16, Tender Wang wrote:

> if (conForm->contype != CONSTRAINT_NOTNULL)
> elog(ERROR, "constraint %u is not a not-null constraint", conForm->oid);
>
> I feel that using conForm->conname is more friendly than oid for users.

Yeah, this doesn't really matter because this function would not be
called with any other kind of constraint anyway. This test could just
as well be an Assert() ... I was pretty torn about that choice TBH (I
still am).

> Others look good for me.

Thanks for looking!

--
Álvaro Herrera 48Β°01'N 7Β°57'E β€” https://www.EnterpriseDB.com/
"No renuncies a nada. No te aferres a nada."

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alastair Turner 2025-04-16 12:53:23 Re: Built-in Raft replication
Previous Message Tender Wang 2025-04-16 12:11:45 Re: not null constraints, again