Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 425869FB548 for ; Wed, 7 Mar 2007 07:53:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 54784-05 for ; Wed, 7 Mar 2007 07:52:50 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id CF90B9FB463 for ; Wed, 7 Mar 2007 07:52:57 -0400 (AST) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 0DDBA77112; Wed, 7 Mar 2007 11:51:08 +0000 (GMT) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id AAA57274067; Wed, 7 Mar 2007 11:51:07 +0000 (GMT) Message-ID: <45EEA72B.1020607@archonet.com> Date: Wed, 07 Mar 2007 11:51:07 +0000 From: Richard Huxton User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: Shavonne Marietta Wijesinghe Cc: pgsql-sql@postgresql.org Subject: Re: PRIMARY KEY References: <003f01c760ac$c8d34980$1102a8c0@dream> In-Reply-To: <003f01c760ac$c8d34980$1102a8c0@dream> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.209 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200703/67 X-Sequence-Number: 27705 Shavonne Marietta Wijesinghe wrote: > Hello > > I have created a table > CREATE TABLE MOD48_00_2007 ( ID text, N_GEN int PRIMARY KEY, FORMSTORE text, COD_NOTAIO text, PA_COGNOME text); > > And i insert the rows via a form in ASP. When the form loads i have a functin that goes and gets the value of the field N_GEN adds 1 to it and shows it to the user. > The problem is when i have 2 users working at the same time. Check the manuals for "sequences" and "serial type". -- Richard Huxton Archonet Ltd