Re: Composite Keys

From: RPK <rohitprakash123(at)indiatimes(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Composite Keys
Date: 2007-02-26 18:23:43
Message-ID: 9164794.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anton Melser 2007-02-26 18:24:57 stored procedure optimisation...
Previous Message Reid Thompson 2007-02-26 18:21:46 Re: proper export table to csv? multilineproblem.