On Tue, Mar 11, 2025 at 1:58 AM Álvaro Herrera <alvhe...@alvh.no-ip.org> wrote: > > Hello, > > I fleshed this out more fully and I think 0001 is good enough to commit. > > I then noticed that constraints on domains are giving bogus error > messages as well, and the situation is easily improved -- see 0002. I'm > not so sure about this one, mainly because test coverage appears scant. > I need to look into this one a bit more. >
hi. this look a little strange? if (cas_bits & (CAS_NOT_DEFERRABLE) && seen) seen->seen_deferrability = true; it should be if ((cas_bits & CAS_NOT_DEFERRABLE) && seen) seen->seen_deferrability = true; ? typedef struct CAS_flags need add to typedefs.list seems didn't cover "initially immediate" case for domain. for example: create domain d_int as int4; --- the following two cases should fail. alter domain d_int add constraint nn1 not null initially immediate; alter domain d_int add constraint cc check(value > 1) initially immediate; we can add the following into processCASbits to make it error out if ((cas_bits & CAS_INITIALLY_IMMEDIATE) && seen) seen->seen_deferrability = true; create domain d_int as int4; alter domain d_int add not null no inherit not valid; ERROR: not-null constraints on domains cannot be marked NOT VALID LINE 1: alter domain d_int add not null no inherit not valid; ^ If we can report an error like "ERROR: NOT NULL constraints on domains cannot be marked INHERIT / NOT INHERIT" That would be great. just report the first constraint property that is not ok, but seems not doable.