pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
To: pgsql-performance-owner@postgresql.org <pgsql-performance-owner@postgresql.org>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Auto generate number in Postgres-9.1.
Date: Mon, 20 Mar 2017 13:38:40 +0000
Message-ID: <ab77f3e1c16540a09002740e283529c5@cyient.com> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Dear expert,

I have to add one column  "ID" in postgres table which will generate Auto Increment<http://www.davidghedini.com/pg/entry/postgresql_auto_increment>ed 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.

view thread (6+ messages)  latest in thread

Message-ID: <ab77f3e1c16540a09002740e283529c5@cyient.com>
Permalink:  ../ab77f3e1c16540a09002740e283529c5@cyient.com/
Also on:    postgresql.org/message-id/ab77f3e1c16540a09002740e283529c5@cyient.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: Dinesh.Chandra@cyient.com, pgsql-performance-owner@postgresql.org
  Subject: Re: Auto generate number in Postgres-9.1.
  In-Reply-To: <ab77f3e1c16540a09002740e283529c5@cyient.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox