Re: how to prevent generating same clipids - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: how to prevent generating same clipids
Date
Msg-id 20060411211409.GA13790@svana.org
Whole thread Raw
In response to Re: how to prevent generating same clipids  (v.suryaprabha@gmail.com)
List pgsql-general
On Mon, Apr 10, 2006 at 10:43:16PM -0700, v.suryaprabha@gmail.com wrote:
> Hi
>    Now we cannot change the field type. Because already our application
> is running and thousands of records are already entered. we are getting
> same no for clipid when 2 users are entering data at a time. so how to
> solve the problem

You don't need to change the field type, you just need to use a
sequence. i.e. nextval/currval. Wherever you're doing max()+1 do a
nextval() instead (after reading the documentation ofcourse).

Have a nice day,

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: How to import a CSV file (originally from Excel) into a Postgresql 8.0.7 database
Next
From: Craig White
Date:
Subject: Re: How to import a CSV file (originally from Excel)