adding foreign key to existing table postgres sql 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)
);