Buen dia!! tengo en mi base de datos postgresql las tablas:
CREATE TABLE requerimiento
(
nombre character varying NOT NULL,
cod_req serial NOT NULL,
CONSTRAINT requerimiento_pkey PRIMARY KEY (cod_req)
)
WITH (
OIDS=FALSE
);
ALTER TABLE requerimiento OWNER TO postgres;
//------------------------------------------------------------------------------------------------
CREATE TABLE tipo_req
(
cod_tipo integer NOT NULL,
nomb_tipo character varying(100),
cod_req integer,
CONSTRAINT tipo_req_pkey PRIMARY KEY (cod_tipo),
CONSTRAINT tipo_req_cod_req_fkey FOREIGN KEY (cod_req)
REFERENCES requerimiento (cod_req) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
WITH (
OIDS=FALSE
);
ALTER TABLE tipo_req OWNER TO postgres;
la duda que tengo es al momento de insertar datos en la tablas tipo_req especificamente la clave foranea cod_req; al ser de tipo serial no veo la forma de acceder a ella para conocer su valor o si existe alguna forma de herencia o algo para insertar.....

please alguien me ayuda???