Hi,
>
I also need the field "lpp_id" as a unique key which is a field that contains a consecutive number of type serial.
Are you sure you REALLY need this? It looks like a lot of trouble for nothing, as you now have one thing warranting the unicity of the record (your serial) plus a unique key warranting you do not couple twice the same language with the same person.
Normally, you'd rather have something like
(person_id)
(language_id)
(weight)
where the primary key is (person_id, language_id) (hence a simple Cartesian product, both elements of the key being FKs to Language and People, or whatever you call your tables) and weight is outside the key, but used for sorting, so you have a preferred language.
What would be the rationale behind the serial number?
Cheers
Bèrto