Re: auto_increment - Mailing list pgsql-sql

From
Subject Re: auto_increment
Date
Msg-id 65456.66.212.203.144.1064043923.squirrel@$HOSTNAME
Whole thread Raw
In response to auto_increment  ("Muhyiddin A.M Hayat" <middink@indo.net.id>)
List 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





pgsql-sql by date:

Previous
From: Jean-Michel Chabanne
Date:
Subject: Re: [ADMIN] Error with functions
Next
From: Andrew Milne
Date:
Subject: Unique Constraint Based on Date Range