Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Composite Keys


  • From: RPK <rohitprakash123(at)indiatimes(dot)com>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: Re: Composite Keys
  • Date: Mon, 26 Feb 2007 10:23:43 -0800 (PST)
  • Message-id: <9164794(dot)post(at)talk(dot)nabble(dot)com>

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.




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group