How to auto-increment? - Mailing list pgsql-general

From Andre Lopes
Subject How to auto-increment?
Date
Msg-id 18f98e680912021452p70f33530x72c37f6268535601@mail.gmail.com
Whole thread Raw
Responses 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>)
List 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 by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Catastrophic changes to PostgreSQL 8.4
Next
From: Greg Williamson
Date:
Subject: Re: How to auto-increment?