By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
ERROR: insert or update on table "dept" violates foreign key constraint "dept_manager_id_fkey"
DETAIL: Key (manager_id)=(101) is not present in table "empl".
ERROR: insert or update on table "empl" violates foreign key constraint "empl_dept_id_fkey"
DETAIL: Key (dept_id)=(1) is not present in table "dept".