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

From Yasuo Honda
Subject Re: CREATE TABLE NOT VALID for check and foreign key
Date
Msg-id CAKmOUTmJdOguNM4SObfPTbZP8AZ3hY88WSWEjD-cDqCKXg-tmw@mail.gmail.com
Whole thread Raw
In response to Re: CREATE TABLE NOT VALID for check and foreign key  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: CREATE TABLE NOT VALID for check and foreign key
List pgsql-hackers
Hi,

On Mon, Dec 23, 2024 at 10:10 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

> Maybe it would have been wise to forbid NOT VALID when used with CREATE
> TABLE.  But we didn't.  Should we do that now?  Maybe we can just
> document that you can specify it but it doesn't do anything.

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.

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

Thanks,
--
Yasuo Honda



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Conflict detection for update_deleted in logical replication
Next
From: Dean Rasheed
Date:
Subject: Re: Adding OLD/NEW support to RETURNING