Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f4GJihA47022 for ; Wed, 16 May 2001 15:44:43 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4ELvCA10595 for ; Mon, 14 May 2001 17:57:12 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f4ELtdj43558 for pgsql-sql@postgresql.org; Mon, 14 May 2001 17:55:39 -0400 (EDT) (envelope-from news) From: "Sylte" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Auto incrementing an integer Date: Mon, 14 May 2001 23:55:51 +0200 Organization: SunSITE.dk - Supporting Opensource Software Lines: 34 Message-ID: <9dpk8p$f5e$1@sunsite.dk> References: <989853345.3afff6a1a3a45@bugs.unl.edu.ar> X-Complaints-To: news@sunsite.dk X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-Authenticated: @ To: pgsql-sql@postgresql.org X-Archive-Number: 200105/175 X-Sequence-Number: 2992 Thanks Martín....I found this http://dis.lib.muohio.edu/code/entry.html?ID=3 Creating an Autoincrement field in Postgresql postgres does this a little differently; the "serial" type creates an integer column, and a sequence used to increment this column. try this: create table table_name( control serial, another_column text, primary key(control) ); results in this: Table = table_name +----------------------------------+----------------------------------+----- --+ | Field | Type | Length| +----------------------------------+----------------------------------+----- --+ | control | int4 not null default nextval('" | 4 | | another_column | text | var | +----------------------------------+----------------------------------+----- --+ Index: table_name_pkey