Inheritance has been setup with FKEY instead of INHERITS due to FKEY limitation.
My question: How to INSERT a new record into bonds
table?
CREATE TABLE IF NOT EXISTS instruments (
id SERIAL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
ticker varchar(255),
type varchar(255),
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS bonds (
id int NOT NULL,
maturity date,
PRIMARY KEY (id),
CONSTRAINT fk_instruments FOREIGN KEY (id) REFERENCES instruments(id)
);
CREATE TABLE IF NOT EXISTS equities (
id int NOT NULL,
name varchar(255),
PRIMARY KEY (id),
CONSTRAINT fk_instruments FOREIGN KEY (id) REFERENCES instruments(id)
);
instruments
.