Re: [HACKERS] AUTO_INCREMENT suggestion
Goran Thyni <goran@bs1.bildbasen.kiruna.se>
From: Goran Thyni <goran@bs1.bildbasen.kiruna.se>
To: "D. Dante Lorenso" <dlorenso@afai.com>
Cc: pgsql-hackers@postgreSQL.org
Date: 1998-03-06T10:26:49Z
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