Jorge, For other tables I have ID field which is incremented by sequence. But for this table, there is not ID field. Receipt No will be incremented by finding the max value from the existing Receipt Nos. corresponding to that Book No. This case has a drawback as compared to the sequences in other tables. Sequences are automatically handled by the database if two users simultaneously enter data. But for the Receipts table where there is no need to define a sequence, one user will find the Max(ReceiptNo) and type in the rest of the entries. So there is a chance that in the meantime another user on a different machine will also get the same max(ReceiptNo) until the record of the previous user gets saved. So how to solve this problem? -- View this message in context: http://www.nabble.com/Composite-Keys-tf3282722.html#a9164794 Sent from the PostgreSQL - general mailing list archive at Nabble.com.