Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Is there an auto incrementing number field?

From: Christian Rudow <Christian(dot)Rudow(at)thinx(dot)ch>
To: Robert Chalmers <robert(at)chalmers(dot)com(dot)au>
Cc: PostgreSQL General <pgsql-general(at)hub(dot)org>
Subject: Re: [GENERAL] Is there an auto incrementing number field?
Date: 1999-06-24 06:56:59
Message-ID: 3771D6BB.49FD27E@thinx.ch (view raw or flat)
Thread:
Lists: pgsql-general
Robert Chalmers wrote:
 
> I'm looking through the 6.5 specs, and wondering if there is an
> Auto-Incrementing field in this release?
> 
> of if not, is there a way of achieving this end? So that as I add a new
> record to a table, it's '#ID' for example is automatically added. 1, 2, 3,
> 4,... and so on

Im using "create sequence ...." on INTEGER id's.
You can also use SERIAL constraint (which does the same thing).

Try pgaccess to have a look at the current state of your sequences.
Nice.

Chris
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christian Rudow                 E-Mail: Christian(dot)Rudow(at)thinx(dot)ch
ThinX networked business services    Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In response to

pgsql-general by date

Next:From: Robert ChalmersDate: 1999-06-24 07:07:15
Subject: Re: [GENERAL] Is there an auto incrementing number field?
Previous:From: dustin sallingsDate: 1999-06-24 06:37:56
Subject: Re: [GENERAL] Is there an auto incrementing number field?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group