mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Expand test a bit
Make pg_constraint output in inherit test show the convalidated column as well. This shows the interaction between convalidated and conenforced. This is extracted from a larger patch so that this reformatting isn't distracting there. Author: Amul Sul <amul.sul@enterprisedb.com> Discussion: https://www.postgresql.org/message-id/flat/CAAJ_b962c5AcYW9KUt_R_ER5qs3fUGbe4az-SP-vuwPS-w-AGA@mail.gmail.com
This commit is contained in:
@ -1353,41 +1353,41 @@ create table p1_fail(f1 int constraint inh_check_constraint6 check (f1 < 10) not
|
||||
NOTICE: merging multiple inherited definitions of column "f1"
|
||||
NOTICE: merging column "f1" with inherited definition
|
||||
ERROR: constraint "inh_check_constraint6" conflicts with NOT ENFORCED constraint on relation "p1_fail"
|
||||
select conrelid::regclass::text as relname, conname, conislocal, coninhcount, conenforced
|
||||
select conrelid::regclass::text as relname, conname, conislocal, coninhcount, conenforced, convalidated
|
||||
from pg_constraint where conname like 'inh\_check\_constraint%'
|
||||
order by 1, 2;
|
||||
relname | conname | conislocal | coninhcount | conenforced
|
||||
---------+-----------------------+------------+-------------+-------------
|
||||
p1 | inh_check_constraint1 | t | 0 | t
|
||||
p1 | inh_check_constraint2 | t | 0 | t
|
||||
p1 | inh_check_constraint3 | t | 0 | f
|
||||
p1 | inh_check_constraint4 | t | 0 | f
|
||||
p1 | inh_check_constraint5 | t | 0 | f
|
||||
p1 | inh_check_constraint6 | t | 0 | f
|
||||
p1 | inh_check_constraint8 | t | 0 | t
|
||||
p1_c1 | inh_check_constraint1 | t | 1 | t
|
||||
p1_c1 | inh_check_constraint2 | t | 1 | t
|
||||
p1_c1 | inh_check_constraint3 | t | 1 | f
|
||||
p1_c1 | inh_check_constraint4 | t | 1 | f
|
||||
p1_c1 | inh_check_constraint5 | t | 1 | t
|
||||
p1_c1 | inh_check_constraint6 | t | 1 | t
|
||||
p1_c1 | inh_check_constraint7 | t | 0 | f
|
||||
p1_c1 | inh_check_constraint8 | f | 1 | t
|
||||
p1_c2 | inh_check_constraint1 | f | 1 | t
|
||||
p1_c2 | inh_check_constraint2 | f | 1 | t
|
||||
p1_c2 | inh_check_constraint3 | f | 1 | f
|
||||
p1_c2 | inh_check_constraint4 | t | 1 | t
|
||||
p1_c2 | inh_check_constraint5 | f | 1 | f
|
||||
p1_c2 | inh_check_constraint6 | f | 1 | f
|
||||
p1_c2 | inh_check_constraint8 | f | 1 | t
|
||||
p1_c3 | inh_check_constraint1 | f | 2 | t
|
||||
p1_c3 | inh_check_constraint2 | f | 2 | t
|
||||
p1_c3 | inh_check_constraint3 | f | 2 | f
|
||||
p1_c3 | inh_check_constraint4 | f | 2 | f
|
||||
p1_c3 | inh_check_constraint5 | f | 2 | t
|
||||
p1_c3 | inh_check_constraint6 | f | 2 | t
|
||||
p1_c3 | inh_check_constraint7 | f | 1 | f
|
||||
p1_c3 | inh_check_constraint8 | f | 2 | t
|
||||
relname | conname | conislocal | coninhcount | conenforced | convalidated
|
||||
---------+-----------------------+------------+-------------+-------------+--------------
|
||||
p1 | inh_check_constraint1 | t | 0 | t | t
|
||||
p1 | inh_check_constraint2 | t | 0 | t | t
|
||||
p1 | inh_check_constraint3 | t | 0 | f | f
|
||||
p1 | inh_check_constraint4 | t | 0 | f | f
|
||||
p1 | inh_check_constraint5 | t | 0 | f | f
|
||||
p1 | inh_check_constraint6 | t | 0 | f | f
|
||||
p1 | inh_check_constraint8 | t | 0 | t | t
|
||||
p1_c1 | inh_check_constraint1 | t | 1 | t | t
|
||||
p1_c1 | inh_check_constraint2 | t | 1 | t | t
|
||||
p1_c1 | inh_check_constraint3 | t | 1 | f | f
|
||||
p1_c1 | inh_check_constraint4 | t | 1 | f | f
|
||||
p1_c1 | inh_check_constraint5 | t | 1 | t | t
|
||||
p1_c1 | inh_check_constraint6 | t | 1 | t | t
|
||||
p1_c1 | inh_check_constraint7 | t | 0 | f | f
|
||||
p1_c1 | inh_check_constraint8 | f | 1 | t | t
|
||||
p1_c2 | inh_check_constraint1 | f | 1 | t | t
|
||||
p1_c2 | inh_check_constraint2 | f | 1 | t | t
|
||||
p1_c2 | inh_check_constraint3 | f | 1 | f | f
|
||||
p1_c2 | inh_check_constraint4 | t | 1 | t | t
|
||||
p1_c2 | inh_check_constraint5 | f | 1 | f | f
|
||||
p1_c2 | inh_check_constraint6 | f | 1 | f | f
|
||||
p1_c2 | inh_check_constraint8 | f | 1 | t | t
|
||||
p1_c3 | inh_check_constraint1 | f | 2 | t | t
|
||||
p1_c3 | inh_check_constraint2 | f | 2 | t | t
|
||||
p1_c3 | inh_check_constraint3 | f | 2 | f | f
|
||||
p1_c3 | inh_check_constraint4 | f | 2 | f | f
|
||||
p1_c3 | inh_check_constraint5 | f | 2 | t | t
|
||||
p1_c3 | inh_check_constraint6 | f | 2 | t | t
|
||||
p1_c3 | inh_check_constraint7 | f | 1 | f | f
|
||||
p1_c3 | inh_check_constraint8 | f | 2 | t | t
|
||||
(30 rows)
|
||||
|
||||
drop table p1 cascade;
|
||||
|
@ -498,7 +498,7 @@ create table p1_c3() inherits(p1, p1_c1);
|
||||
-- but not allowed if the child constraint is explicitly asked to be NOT ENFORCED
|
||||
create table p1_fail(f1 int constraint inh_check_constraint6 check (f1 < 10) not enforced) inherits(p1, p1_c1);
|
||||
|
||||
select conrelid::regclass::text as relname, conname, conislocal, coninhcount, conenforced
|
||||
select conrelid::regclass::text as relname, conname, conislocal, coninhcount, conenforced, convalidated
|
||||
from pg_constraint where conname like 'inh\_check\_constraint%'
|
||||
order by 1, 2;
|
||||
|
||||
|
Reference in New Issue
Block a user