Re: How to auto-increment?

From: Greg Williamson <gwilliamson39(at)yahoo(dot)com>
To: Andre Lopes <lopes80andre(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to auto-increment?
Date: 2009-12-02 23:07:19
Message-ID: 472459.25755.qm@web46103.mail.sp1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-12-02 23:09:09 Re: How to auto-increment?
Previous Message Andre Lopes 2009-12-02 22:52:51 How to auto-increment?