Re: [HACKERS] AUTO_INCREMENT suggestion - Mailing list pgsql-hackers

From Mattias Kregert
Subject Re: [HACKERS] AUTO_INCREMENT suggestion
Date
Msg-id 3503DBAA.1718507A@algonet.se
Whole thread Raw
In response to Re: [HACKERS] AUTO_INCREMENT suggestion  (ocie@paracel.com)
List pgsql-hackers
ocie@paracel.com wrote:
> > > the Autonumber feature in Access as well.
> > >
> > > create table tblFirm (
> > >     FirmID int PRIMARY KEY AUTO_INCREMENT,
>
> > 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.
>
> Sybase calls this an identity.  I don't think there is a standard name
> for this, sigh.
>
> Ocie


How about adding all those keywords?
  AUTONUMBER, IDENTITY, AUTO_INCREMENT, SERIAL

Then, anybody could switch to PostgreSQL without having to relearn
this.

Would it be possible to have a "compatability" variable, like this?
  psql=> set sqlmode to {STRICT_ANSI|POSTGRESQL|ORACLE  ...}
so that ppl can set it to STRICT when they want to write portable
SQL, and PGSQL when they want all these nice features?

/* m */

pgsql-hackers by date:

Previous
From: Zeugswetter Andreas
Date:
Subject: AW: [HACKERS] newoid in invapi.c
Next
From: Mattias Kregert
Date:
Subject: Re: [HACKERS] Execution time