X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4D12A9FB33F for ; Fri, 22 Sep 2006 19:00:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 14227-04 for ; Fri, 22 Sep 2006 19:00:31 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by postgresql.org (Postfix) with ESMTP id A47289FA4E0 for ; Fri, 22 Sep 2006 19:00:30 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d80so1538925pyd for ; Fri, 22 Sep 2006 15:00:29 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WUTshQSohOOhNS8X+4wr+MA3noC8kpaIyaGRFE5pOjxpBW9vYiXdZG2ARVq12Jivk2OLhPM4ytvNJLWNPvlMYUS97TB8SOelSERXedeqirnemjEQ1hBLVB1fdw6tOuZXz/7aPagx5NeY/w9UXmfjO8MO2gWe1N39jQBVt4zsfog= Received: by 10.35.61.17 with SMTP id o17mr2286554pyk; Fri, 22 Sep 2006 15:00:29 -0700 (PDT) Received: by 10.35.38.9 with HTTP; Fri, 22 Sep 2006 15:00:25 -0700 (PDT) Message-ID: Date: Sat, 23 Sep 2006 10:00:29 +1200 From: "Andrew Chilton" To: pgsql-sql@postgresql.org Subject: Re: How to autoincrement a primary key... In-Reply-To: <20060922192541.46464.qmail@web31815.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <000001c6de7b$3a211c70$6501a8c0@laptop> <20060922192541.46464.qmail@web31815.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, SPF_PASS, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200609/159 X-Sequence-Number: 26370 On 23/09/06, Richard Broersma Jr wrote: > Is just shorthand notation for: > > CREATE SEQUENCE foo START 1; > CREATE TABLE bar (id integer PRIMARY KEY DEFAULT nextval('bar')); Doug, just a slight typo correction in that second line Richard gave you (bar should be foo), it should read in full: CREATE SEQUENCE foo START 1; CREATE TABLE bar (id integer PRIMARY KEY DEFAULT nextval('foo')); Andy -- name: Andrew Chilton web: http://kapiti.geek.nz/