Re: Composite Keys - Mailing list pgsql-general

From RPK
Subject Re: Composite Keys
Date
Msg-id 9164794.post@talk.nabble.com
Whole thread Raw
In response to Re: Composite Keys  (Jorge Godoy <jgodoy@gmail.com>)
Responses Re: Composite Keys  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-general
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.


pgsql-general by date:

Previous
From: Reid Thompson
Date:
Subject: Re: proper export table to csv? multilineproblem.
Next
From: "Anton Melser"
Date:
Subject: stored procedure optimisation...