X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3BDF7D1B52A for ; Sat, 20 Sep 2003 07:39:38 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 90360-01 for ; Sat, 20 Sep 2003 04:39:07 -0300 (ADT) Received: from mail.seaworthysystems.com (216-238-112-88.dsl.ct.thebiz.net [216.238.112.88]) by svr1.postgresql.org (Postfix) with ESMTP id 12ECCD1B4E5 for ; Sat, 20 Sep 2003 04:39:05 -0300 (ADT) Received: from seaworthysystems.com (localhost.localdomain [127.0.0.1]) by mail.seaworthysystems.com (Postfix) with SMTP id 4BF121B693; Sat, 20 Sep 2003 03:45:23 -0400 (EDT) Received: from 66.212.203.144 (SquirrelMail authenticated user btober) by $HOSTNAME with HTTP; Sat, 20 Sep 2003 03:45:23 -0400 (EDT) Message-ID: <65456.66.212.203.144.1064043923.squirrel@$HOSTNAME> Date: Sat, 20 Sep 2003 03:45:23 -0400 (EDT) Subject: Re: auto_increment From: To: In-Reply-To: <008501c37f35$832e26e0$1f00a8c0@middinkcomp> References: <008501c37f35$832e26e0$1f00a8c0@middinkcomp> X-Priority: 3 Importance: Normal Cc: X-Mailer: SquirrelMail (version 1.2.9) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/231 X-Sequence-Number: 15209 > 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