[PERFORM] Auto generate number in Postgres-9.1. - Mailing list pgsql-performance

From Dinesh Chandra 12108
Subject [PERFORM] Auto generate number in Postgres-9.1.
Date
Msg-id ab77f3e1c16540a09002740e283529c5@cyient.com
Whole thread Raw
Responses Re: [PERFORM] Auto generate number in Postgres-9.1.
List pgsql-performance

Dear expert,

 

I have to add one column  “ID” in postgres table which will generate Auto Incremented number .

 

Example:

Suppose I have five records and if I insert 1 new record It should auto generate 6.

If I truncate the same table and then again insert rows should start with 1 in “ID” column.

 

Regards,

Dinesh Chandra

|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.




DISCLAIMER:

This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Check all attachments for viruses before opening them. All views or opinions presented in this e-mail are those of the author and may not reflect the opinion of Cyient or those of our affiliates.

pgsql-performance by date:

Previous
From: Jeff Janes
Date:
Subject: Re: [PERFORM] Please help with a slow query: there are millions ofrecords, what can we do?
Next
From: Josh Berkus
Date:
Subject: Re: [PERFORM] Auto generate number in Postgres-9.1.