Re: [HACKERS] AUTO_INCREMENT suggestion

From: Goran Thyni <goran(at)bs1(dot)bildbasen(dot)kiruna(dot)se>
To: "D(dot) Dante Lorenso" <dlorenso(at)afai(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] AUTO_INCREMENT suggestion
Date: 1998-03-06 10:26:49
Message-ID: 34FFCF69.44236E21@bildbasen.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

D. Dante Lorenso wrote:
>
> To aid those of us that don't want to use sequences, can we add a
> feature to 6.4 that allows the use of an AUTO_INCREMENT statement
> when defining tables? MySQL does this, and I like it. It resembles
> the Autonumber feature in Access as well.
>
> create table tblFirm (
> FirmID int PRIMARY KEY AUTO_INCREMENT,
> FirmTypeID int,
> FirmName varchar(64) NOT NULL,
> FirmAlpha char(20) NOT NULL UNIQUE,
> FirmURL varchar(64),
> FirmEmail varchar(64)
> );
>
> Just yet another suggestion.
>

Informix calls something like this SERIAL type, like:

create table tblFirm (
FirmID SERIAL PRIMARY KEY,
FirmTypeID int,
FirmName varchar(64) NOT NULL,
FirmAlpha char(20) NOT NULL UNIQUE,
FirmURL varchar(64),
FirmEmail varchar(64)
);

Don't know if that is standrd or extension.

We use "CREATE SEQUENCE" to do this is PgSQL.

regards,
--
---------------------------------------------
Göran Thyni, sysadm, JMS Bildbasen, Kiruna

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mattias Kregert 1998-03-06 10:40:38 Re: [HACKERS] domain feature - details
Previous Message Peter T Mount 1998-03-06 06:56:55 Re: [QUESTIONS] Re: [HACKERS] text should be a blob field