Re: cataloguing NOT NULL constraints

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: cataloguing NOT NULL constraints
Date: 2023-03-27 13:55:27
Message-ID: a3641b38-4547-fd26-855b-045e2736672a@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15.03.23 23:44, Alvaro Herrera wrote:
> Here's v5. I removed the business of renaming constraints in child
> relations: recursing now just relies on matching column names. Each
> column has only one NOT NULL constraint; if you try to add another,
> nothing happens. All in all, this code is pretty similar to how we
> handle inheritance of columns, which I think is good.

This patch looks pretty okay to me now. It matches all the functional
expectations.

I suggest going through the tests carefully again and make sure all the
changes are sensible and all the comments are correct. There are a few
places where the behavior of tests has changed (intentionally) but the
surrounding comments don't match anymore, or objects that previously
weren't created now succeed but then affect following tests. Also, it
seems some tests are left over from the first variant of this patch
(where not-null constraints were converted to check constraints), and
test names or comments should be updated to the current behavior.

I suppose we don't need any changes in pg_dump, since ruleutils.c
handles that?

The information schema should be updated. I think the following views:

- CHECK_CONSTRAINTS
- CONSTRAINT_COLUMN_USAGE
- DOMAIN_CONSTRAINTS
- TABLE_CONSTRAINTS

It looks like these have no test coverage; maybe that could be addressed
at the same time.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2023-03-27 14:00:38 Re: generic plans and "initial" pruning
Previous Message torikoshia 2023-03-27 13:51:32 Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)