Skip site navigation (1) Skip section navigation (2)

Re: how to create field auto increas value

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "gunartha(dot)nyoman" <gunartha(dot)nyoman(at)ptjas(dot)co(dot)id>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: how to create field auto increas value
Date: 2007-03-20 02:29:41
Message-ID: 45FF4715.4000305@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-admin
gunartha.nyoman wrote:
> Dear All,
> 
> I am trying to create table which have one field auto increas value like autonumber in ms access.
> My question is how to create this auto increas field.

create table foo (id serial);

also see currval(), nextval()

Sincerely,

Joshua D. Drake

> 
> Thank a lot for your attention
> 
> Regards,
> Nyoman/Bali
> 
> 
> 


-- 

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


In response to

pgsql-admin by date

Next:From: gunartha.nyomanDate: 2007-03-20 02:45:07
Subject: Re: how to add oids field
Previous:From: Phillip SmithDate: 2007-03-20 02:19:51
Subject: Re: how to create field auto increas value

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group