X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C03A4D1B583 for ; Sat, 20 Sep 2003 11:17:07 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 29357-02 for ; Sat, 20 Sep 2003 08:16:38 -0300 (ADT) Received: from smtp1.gigared.com (unknown [200.68.216.5]) by svr1.postgresql.org (Postfix) with ESMTP id E43EED1B582 for ; Sat, 20 Sep 2003 08:16:34 -0300 (ADT) Received: from 10.41.130.123 (unknown [10.41.130.123]) by smtp1.gigared.com (Postfix) with SMTP id 9020A326FF; Sat, 20 Sep 2003 08:14:46 -0300 (GMT) From: Martin Marques To: Oliver Elphick , "Muhyiddin A.M Hayat" Subject: Re: auto_increment Date: Sat, 20 Sep 2003 08:15:13 -0300 User-Agent: KMail/1.5 Cc: pgsql-sql@postgresql.org References: <008501c37f35$832e26e0$1f00a8c0@middinkcomp> <1064038995.5359.70.camel@linda.lfix.co.uk> In-Reply-To: <1064038995.5359.70.camel@linda.lfix.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200309200815.13766.martin@bugs.unl.edu.ar> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/220 X-Sequence-Number: 15198 El S=E1b 20 Sep 2003 03:23, Oliver Elphick escribi=F3: > 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. --=20 Porqu=E9 usar una base de datos relacional cualquiera, si pod=E9s usar PostgreSQL? ----------------------------------------------------------------- Mart=EDn Marqu=E9s | mmarques@unl.edu.ar Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------