Re: auto_increment

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: auto_increment
Дата
Msg-id 200309201105.30370.dev@archonet.com
обсуждение исходный текст
Ответ на Re: auto_increment  ("Muhyiddin A.M Hayat" <middink@indo.net.id>)
Список pgsql-sql
On Saturday 20 September 2003 09:43, Muhyiddin A.M Hayat wrote:
> Ok, but if i do rollback, the auto_increment don't roolback.

It's not supposed to.

> How to use nextval(), currval() and setval() functions.

Something like: INSERT INTO my_table(nextval('my_sequence_name'),'aaa',1);
But you'll get the same problem.

What are you trying to do with the auto-increment? If you want to guarantee 
that the numbers go up in sequence and have no gaps (e.g. 1,2,3,4,5 NOT 
1,2,4,6) then you'll need to do some more work.

Think about what you want to have happen when three clients insert rows at the 
same time and one rolls back. Once you've decided what you want, ask again if 
you need some help.

--  Richard Huxton Archonet Ltd


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

Предыдущее
От: "Muhyiddin A.M Hayat"
Дата:
Сообщение: Re: auto_increment
Следующее
От: "Muhyiddin A.M Hayat"
Дата:
Сообщение: Re: auto_increment