Re: CREATE TABLE NOT VALID for check and foreign key - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: CREATE TABLE NOT VALID for check and foreign key
Date
Msg-id 202501081336.5ntcq5oar24r@alvherre.pgsql
Whole thread Raw
In response to Re: CREATE TABLE NOT VALID for check and foreign key  (Yasuo Honda <yasuo.honda@gmail.com>)
List pgsql-hackers
Hello,

On 2025-Jan-07, Yasuo Honda wrote:

> I'd like PostgreSQL to raise errors and/or warnings for the NOT VALID
> check constraint for CREATE TABLE.
> Ruby on Rails supports creating check constraints with the NOT VALID
> option and I was not aware that it is just ignored until
> https://github.com/rails/rails/issues/53732 issue is reported.

Thanks.  I left a comment there.  I think raising a WARNING might work.

> Rails has implemented a kind of workaround by not dumping the NOT
> VALID option, but it does not help for the first execution.
> https://github.com/rails/rails/pull/53735

Yeah, that's probably not ideal.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"You're _really_ hosed if the person doing the hiring doesn't understand
relational systems: you end up with a whole raft of programmers, none of
whom has had a Date with the clue stick."              (Andrew Sullivan)
https://postgr.es/m/20050809113420.GD2768@phlogiston.dyndns.org



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: ecpg command does not warn COPY ... FROM STDIN;
Next
From: Peter Eisentraut
Date:
Subject: Re: Moving the vacuum GUCs' docs out of the Client Connection Defaults section