How to auto-increment?

Поиск
Список
Период
Сортировка
От Andre Lopes
Тема How to auto-increment?
Дата
Msg-id 18f98e680912021452p70f33530x72c37f6268535601@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to auto-increment?  (Greg Williamson <gwilliamson39@yahoo.com>)
Re: How to auto-increment?  (John R Pierce <pierce@hogranch.com>)
Re: How to auto-increment?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-general
Hi,
 
I have a table like this:
 
id_product
id_increment
 
and I need to increment values in id_increment like this
 
prod_1
1
 
prod_1
2
 
prod_1
3
 
prod_2
1
 
Wich is the best way to do this? Using a trigger? Where can I find examples of plpgsql doing this?
 
Best Regards, André.
 
Sorry for my bad english.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Catastrophic changes to PostgreSQL 8.4
Следующее
От: Greg Williamson
Дата:
Сообщение: Re: How to auto-increment?