Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: jian he <jian.universality@gmail.com>
Cc: Rushabh Lathia <rushabh.lathia@gmail.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-03-17T11:23:25Z
Lists: pgsql-hackers
Attachments
On 2025-Mar-17, jian he wrote: > hi. > I played around with it. > > current syntax, we don't need to deal with column constraint grammar. > like the following can fail directly: > create table t0(a int constraint nn not null a not valid); > we only support table constraint cases like: > alter table lp add constraint nc1 not null a not valid; > > since CREATE TABLE with invalid constraint does not make sense, so > we can just issue a warning. like: > create table t0(a int, constraint nn not null a not valid); > WARNING: CREATE TABLE NOT NULL NOT VALID CONSTRAINT WILL SET TO VALID > the wording needs to change... Yeah, we discussed this elsewhere. I have an alpha-quality patch for that, but I wasn't too sure about it ... [1] https://postgr.es/m/CACJufxEQcHNhN6M18JY1mQcgQq9Gn9ofMeop47SdFDE5B8wbug@mail.gmail.com -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Commits
-
Allow NOT NULL constraints to be added as NOT VALID
- a379061a22a8 18.0 landed
-
Add missing deparsing of [NO] IDENT to XMLSERIALIZE()
- 984410b92326 18.0 cited
-
backend launchers void * arguments for binary data
- 7202d72787d3 18.0 cited
-
Add pg_constraint rows for not-null constraints
- 14e87ffa5c54 18.0 cited
-
Create the infrastructure for planner support functions.
- 1fb57af92069 12.0 cited
-
Add prokind column, replacing proisagg and proiswindow
- fd1a421fe661 11.0 cited