By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
1 rows affected
1 rows affected
ERROR: insert or update on table "organization" violates foreign key constraint "valid_project_fk"
DETAIL: Key (project_id, project_id_valid)=(2, t) is not present in table "project".
1 rows affected
| project_id | project | project_id_valid |
|---|---|---|
| 1 | project1 | t |
| org_id | org | project_id | project_id_valid |
|---|---|---|---|
| 1 | agency X | 1 | t |
| 3 | agency Y | 2 | null |