Re: not null constraints, again - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: not null constraints, again
Date
Msg-id 202504161224.xedjghsndf7w@alvherre.pgsql
Whole thread Raw
In response to Re: not null constraints, again  (Tender Wang <tndrwang@gmail.com>)
List 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."



pgsql-hackers by date:

Previous
From: Tender Wang
Date:
Subject: Re: not null constraints, again
Next
From: Alastair Turner
Date:
Subject: Re: Built-in Raft replication