hi Louis-David,
> tmp := nextval('cabin_type_id_cabin_type_seq');
seems to me you're adding a newly created key value (for which there isn't a record yet).
--
regards, jr. (jr(at)tailorware(dot)org(dot)uk)