Search Postgresql Archives

Re: how to prevent generating same clipids

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On mán, 2006-04-10 at 22:43 -0700, v.suryaprabha@xxxxxxxxx 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

create a sequence:
CREATE SEQUENCE clipid_seq 
   START WITH somehighenoughnumber

now use that when you allocate ids.
i.e. instead of 
  SELECT 1+max(clipid) FROM yourtable
do:
  SELECT nexval(clipid_seq)

gnari




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux