Received: from post.gateone.com (qmailr@post.gateone.com [204.244.205.25]) by hub.org (8.8.8/8.7.5) with SMTP id QAA29830 for ; Mon, 18 May 1998 16:37:15 -0400 (EDT) Received: (qmail 2228 invoked from network); 18 May 1998 20:37:27 -0000 Received: from trevor.gateone.com (HELO wizard.ca) (204.244.205.12) by mail.gateone.com with SMTP; 18 May 1998 20:37:27 -0000 Message-ID: <35609B0F.52A63C2@wizard.ca> Date: Mon, 18 May 1998 13:33:19 -0700 From: The Web Administrator Reply-To: wwwadmin@wizard.ca X-Mailer: Mozilla 4.04 [en] (Win95; I) MIME-Version: 1.0 To: PGsql Subject: How to handle a requirement for nextval Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I am still struggling on a few issues, have got my first little database up and running, and am quite happy with PostGres, but I cannot figure out how to create a table which can have a field that autoincrements.. I am sure that somewhere in the oid terminology it is built in, but I want to have a counter on some table entries.. ie... CREATE TABLE clothing_type ( type_id INT NOT NULL, description TEXT, for_sex CHAR ); INSERT INTO clothing_type ( description, for_sex ) VALUES ( 'pants', 'm' ); What I want is that the Primary Key (Only Key) be type_id, and int, and the first item that I insert should have type_id as '1', next will be '2' etc.. I could have every insert into this table include a type_id, but that seems unessary. Can I have something like default='nextval' ?