From: | Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar> |
---|---|
To: | Oliver Elphick <olly(at)lfix(dot)co(dot)uk>, "Muhyiddin A(dot)M Hayat" <middink(at)indo(dot)net(dot)id> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: auto_increment |
Date: | 2003-09-20 11:15:13 |
Message-ID: | 200309200815.13766.martin@bugs.unl.edu.ar |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)unl(dot)edu(dot)ar
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | shyamperi | 2003-09-20 11:16:28 | Re: Error with functions |
Previous Message | Muhyiddin A.M Hayat | 2003-09-20 10:14:38 | Re: auto_increment |