Re: Catalog domain not-null constraints

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Aleksander Alekseev <aleksander@timescale.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, jian he <jian.universality@gmail.com>, vignesh C <vignesh21@gmail.com>
Date: 2024-03-20T09:41:33Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix ALTER DOMAIN NOT NULL syntax

  2. Catalog domain not-null constraints

  3. Add tests for domain-related information schema views

On 18.03.24 11:02, Aleksander Alekseev wrote:
> Hi,
> 
>> Anyway, in order to move this forward, here is an updated patch where
>> the ADD CONSTRAINT ... NOT NULL behavior for domains matches the
>> idempotent behavior of tables.  This uses the patch that Jian He posted.
> 
> I tested the patch on Raspberry Pi 5 and Intel MacBook and also
> experimented with it. Everything seems to work properly.
> 
> Personally I believe new functions such as
> validateDomainNotNullConstraint() and findDomainNotNullConstraint()
> could use a few lines of comments (accepts..., returns..., etc).

Done.

> Also
> I think that the commit message should explicitly say that supporting
> NOT VALID constraints is out of scope of this patch.

Not done.  I don't know what NOT VALID has to do with this.  This patch 
just changes the internal catalog representation, it doesn't claim to 
add or change any features.  The documentation already accurately states 
that NOT VALID is not supported for NOT NULL constraints.

> Except for named nitpicks v4 LGTM.

Committed, thanks.