In such a case, I'd make a separate table for each part type for the sole purpose of treating its auto-increment column as the serial. Use an insert trigger on each part type table to copy the whole row + constant part type ID to the main table. Carry on with the main table. (Can prune the separate tables after the main table is updated. Perhaps place the part type tables in their own schema to avoid misuse.)
1 Like