Re: [GENERAL] auto number

From: Peter Eisentraut <e99re41(at)DoCS(dot)UU(dot)SE>
To: Marco Giardini <marco(at)tecnogi(dot)com>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] auto number
Date: 2000-02-22 13:05:26
Message-ID: Pine.GSO.4.02A.10002221404290.14754-100000@Haj.DoCS.UU.SE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 22 Feb 2000, Marco Giardini wrote:

> how do i set a table with an autonumebr field? I mean a field that it's
> automatically increased by one for each added record.

Use a SERIAL column.

E.g.:

create table x (a text, b serial);
insert into x(a) values ('abc');

--
Peter Eisentraut Sernanders vaeg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

  • auto number at 2000-02-22 11:45:29 from Marco Giardini

Browse pgsql-general by date

  From Date Subject
Next Message Gönczi Zoltán 2000-02-22 13:36:41 delphi3.0+postgres
Previous Message Dmitry Samersoff 2000-02-22 12:13:12 RE: [HACKERS] TRANSACTIONS