Re: auto_increment - Mailing list pgsql-sql

From sad
Subject Re: auto_increment
Date
Msg-id 200309220915.04899.sad@bankir.ru
Whole thread Raw
In response to Re: auto_increment  (Oliver Elphick <olly@lfix.co.uk>)
Responses Re: auto_increment
List pgsql-sql
On Saturday 20 September 2003 10:23, you wrote:
> 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().

I believe it is better to EXPLICITLY declare a SEQUENCE and
set the default value nextval() to the field.



pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Cross joining table with itself
Next
From: sad
Date:
Subject: Re: Reg: Firing Trigger when a particular column value get changed