Auto generate number in Postgres-9.1.

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

 



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.

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux