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: no detail for master_id=1
CONTEXT: PL/pgSQL function assert_master_has_detail() line 5 at RAISE
1 rows affected
1 rows affected
ERROR: last detail for master_id=1 removed, but master still exists
CONTEXT: PL/pgSQL function assert_no_leftover_master() line 6 at RAISE
1 rows affected
1 rows affected