On 2025-Jan-15, Amul Sul wrote:
> I might be mistaken, but I believe this behavior is reasonable since
> we're creating a new table with no data initially. Future inserts will
> be validated against the constraint, ensuring all data added complies
> with it. Given that any data in the table at any
On Thu, Dec 5, 2024 at 3:06 PM Alvaro Herrera wrote:
>
> Hello,
>
> On 2024-Dec-05, jian he wrote:
>
> > I found for foreign keys, check constraints,
> > you specify it as NOT VALID, it will not be marked as NOT VALID in the
> > CREATE TABLE statement.
>
> Uhmm, okay.
>
> > reading transformCheckC
On 2025-Jan-08, Alvaro Herrera wrote:
> 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 tha
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
Hi,
On Mon, Dec 23, 2024 at 10:10 AM Alvaro Herrera 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 er
turns out this has already been discussed at [1]
NOT VALID only applies to table_constraint.
Amit Langote actually wrote the doc at[1], so I copied some text from there.
in create_table.sgml, i placed right below
INITIALLY IMMEDIATE
INITIALLY DEFERRED
so it looks like this:
NOT VALID
On Thu, 5 Dec 2024 at 14:36, Alvaro Herrera 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.
+1 on that
--
Best regards,
Kirill Reshk
hi.
I found for foreign keys, check constraints,
you specify it as NOT VALID, it will not be marked as NOT VALID in the
CREATE TABLE statement.
CREATE TABLE s6(id bigint , CONSTRAINT con1 check(id > 1) not valid);
src2=# \d s6
Table "public.s6"
Column | Type | Collation | Nullab
Hello,
On 2024-Dec-05, jian he wrote:
> I found for foreign keys, check constraints,
> you specify it as NOT VALID, it will not be marked as NOT VALID in the
> CREATE TABLE statement.
Uhmm, okay.
> reading transformCheckConstraints, transformFKConstraints comments
> appearingly this is intentio