Search Postgresql Archives

Re: how to prevent generating same clipids

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

 



On Mon, 2006-04-10 at 07:02, v.suryaprabha@xxxxxxxxx wrote:
> Hi All,
> 
> I am having the clipid field in my table.In my application  i am taking
> Max(clipid) and inserting it into the table by incrementing that max
> value. so there is a problem when 2 users click sumbit button at a
> time. we r getiing same value . so hoe to solve the problem

You need to use a sequence.

You can either have the database assign the value automatically by
declaring the field type to be serial (instead of int) or bigserial
(instead of int8) or you can assign the value yourself using the nextval
/ currval functions.


[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