Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C93BC632670 for ; Fri, 21 May 2010 04:20:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 15797-09 for ; Fri, 21 May 2010 07:19:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tmailer.gwdg.de (tmailer.gwdg.de [134.76.10.23]) by mail.postgresql.org (Postfix) with ESMTP id 1DE476327DE for ; Fri, 21 May 2010 04:19:54 -0300 (ADT) Received: from mailer-b1.gwdg.de ([134.76.10.30] helo=mailbox.gwdg.de) by mailer.gwdg.de with esmtp (Exim 4.69) (envelope-from ) id 1OFMWP-0004oB-7E for pgsql-sql@postgresql.org; Fri, 21 May 2010 09:19:53 +0200 X-Xeceived: from 84.132.162.11 (SquirrelMail authenticated user tlange) by mailbox.gwdg.de with HTTP; Fri, 21 May 2010 09:19:53 +0200 Message-ID: Date: Fri, 21 May 2010 09:19:53 +0200 Subject: [Fwd: Re: sorry, now with subject... trigger & nextval(seq)] From: tlange@gwdg.de To: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.20 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: (clean) by exiscan+sophie X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-5 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/97 X-Sequence-Number: 34145 > On Thursday 20 May 2010 5:53:51 pm tlange@gwdg.de wrote: >> I'm new to triggers in PostgreSQL. I have to create a trigger on insert >> to >> increment a sequence to overcome MS-Access' limitation in acknowledging >> serial "datatype". >> > > You know serial is just a shortcut for: > > pid int NOT NULL DEFAULT nextval('seq') yes. sorry datatype quoted was bit ambiguous. > I think you will find Access will place nice if you use the long form to > define > your autoincrement. > Ok, I'll give it a try! Thank you, Torsten