Re: auto_increment

From: <btober(at)seaworthysys(dot)com>
To: <middink(at)indo(dot)net(dot)id>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: auto_increment
Date: 2003-09-20 07:45:23
Message-ID: 65456.66.212.203.144.1064043923.squirrel@$HOSTNAME
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> How to Create auto_increment field in PostreSQL.

Its called the SERIAL datatype:

create table test_table (
field1 serial,
constraint test_table_pkey primary key (field1));

> Can I create them using Trigger.

Yes, alternatively, but I'm told that is not recommended because the
server source code that manages the special sequence table is highly
optimized for this specific functionality.

~Berend Tober

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Muhyiddin A.M Hayat 2003-09-20 08:43:10 Re: auto_increment
Previous Message Jean-Michel Chabanne 2003-09-20 07:29:24 Re: Error with functions