create table taba( id int PRIMARY KEY, name text);
create table tabb( rid int PRIMARY KEY REFERENCES taba(id));
insert into taba values (1,'1');
insert into taba values (2,'2');
insert into tabb values(1);
explain delete from taba where id = 1;
explain delete from taba where id = 2;
The explain doesn't show any checking of the constraint, but the checking is done
somewhere. How much does the checking cost? If I delete any value from taba does it
check tabb to see if that row is refrenced, is something marked in the taba row to
indicate it is refrenced? If I update taba does it check only if I update id, or will it
check no matter what field I update?