faq u white devles!
faq u white devles!
From the message you got, it sounds like the problem may not be with the "mandatory" property of the database field, rather than timing of when the unique key is assigned. If the "mandatory" property of the column = TRUE, then you have to supply some value, regardless of whether the column is part of an index.
faq u white devles!
faq u white devles!
why do you expect a race condition there? the trigger will fire as part of the transaction, next-value will give you the unique sequence number you were after... unless the sequence get removed, in which case the trigger will fail to assign a new value and then you'll have that unique constraint violation because all records will keep the default value (-1), but as long as the sequence is there it won't be any race condition.
faq u white devles!