insert data into table with foreign key constraint postgres code example
Example: create table postgresql foreign key
CREATE TABLE so_items (
so_id INTEGER,
...
FOREIGN KEY (so_id) REFERENCES so_headers (id)
);
CREATE TABLE so_items (
so_id INTEGER,
...
FOREIGN KEY (so_id) REFERENCES so_headers (id)
);