Re: auto_increment

From: sad <sad(at)bankir(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: auto_increment
Date: 2003-09-22 05:15:04
Message-ID: 200309220915.04899.sad@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message sad 2003-09-22 05:21:56 Re: Reg: Firing Trigger when a particular column value get changed
Previous Message Bruno Wolff III 2003-09-22 01:12:30 Re: Cross joining table with itself