Re: auto_increment - Mailing list pgsql-sql

From Martin Marques
Subject Re: auto_increment
Date
Msg-id 200309200815.13766.martin@bugs.unl.edu.ar
Whole thread Raw
In response to Re: auto_increment  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-sql
El Sáb 20 Sep 2003 03:23, Oliver Elphick escribió:
> On Sat, 2003-09-20 at 06:10, Muhyiddin A.M Hayat wrote:
> > How to Create auto_increment field in PostreSQL.
> > Can I create them using Trigger.
>
> Use the SERIAL datatype.  See also the functions nextval(), currval()
> and setval().

Also to add, the auto increment is done through sequences.

I would suggest seeing the docs on SEQUENCE, and SERIAL data type.

--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telematica                      Universidad Nacional
        del Litoral 
-----------------------------------------------------------------



pgsql-sql by date:

Previous
From: "Muhyiddin A.M Hayat"
Date:
Subject: Re: auto_increment
Next
From: Martin Marques
Date:
Subject: Re: auto_increment