By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
CREATE TABLE
ALTER TABLE
INSERT 0 1
| meeting_id | first_session_id | cost | startdate | enddate |
|---|---|---|---|---|
| 1 | 1 | 1 | 2023-03-08 | 2023-03-09 |
SELECT 1
| session_id | meeting_id | startdate | enddate |
|---|---|---|---|
| 1 | 1 | 2023-03-08 | 2023-03-09 |
SELECT 1
ERROR: insert or update on table "meeting" violates foreign key constraint "meeting_first_session_id_fkey" DETAIL: Key (meeting_id, first_session_id)=(2, 1) is not present in table "session".
ERROR: null value in column "first_session_id" of relation "meeting" violates not-null constraint DETAIL: Failing row contains (3, null, 1, 2023-03-08, 2023-03-09).