Re: how to prevent generating same clipids

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: v(dot)suryaprabha(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to prevent generating same clipids
Date: 2006-04-11 21:14:09
Message-ID: 20060411211409.GA13790@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 10, 2006 at 10:43:16PM -0700, v(dot)suryaprabha(at)gmail(dot)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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig White 2006-04-12 02:08:15 Re: How to import a CSV file (originally from Excel)
Previous Message Magnus Hagander 2006-04-11 21:13:06 Re: How to import a CSV file (originally from Excel) into a Postgresql 8.0.7 database