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

From Greg Williamson
Subject Re: How to auto-increment?
Date
Msg-id 472459.25755.qm@web46103.mail.sp1.yahoo.com
Whole thread Raw
In response to How to auto-increment?  (Andre Lopes <lopes80andre@gmail.com>)
List pgsql-general
See the data type "SERIAL" in the PostgreSQL manual for whatever flavor of the database you are using ...

Apologies for top-posting -- challenged mail client.

HTH,

Greg W.


From: Andre Lopes <lopes80andre@gmail.com>
To: pgsql-general@postgresql.org
Sent: Wed, December 2, 2009 2:52:51 PM
Subject: [GENERAL] How to auto-increment?

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: Andre Lopes
Date:
Subject: How to auto-increment?
Next
From: John R Pierce
Date:
Subject: Re: How to auto-increment?