Re: how to prevent generating same clipids

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: how to prevent generating same clipids
Дата
Msg-id 20060411211409.GA13790@svana.org
обсуждение исходный текст
Ответ на Re: how to prevent generating same clipids  (v.suryaprabha@gmail.com)
Список 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.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: How to import a CSV file (originally from Excel) into a Postgresql 8.0.7 database
Следующее
От: Craig White
Дата:
Сообщение: Re: How to import a CSV file (originally from Excel)