Search Postgresql Archives

Re: How to auto-increment?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
To: pgsql-general@xxxxxxxxxxxxxx
Sent: Wed, December 2, 2009 2:52:51 PM
Subject: 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux