Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 82F6E9FB522 for ; Fri, 9 Mar 2007 18:40:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 89001-02 for ; Fri, 9 Mar 2007 18:40:09 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from weatherbeeta.com.au (218-214-212-153.people.net.au [218.214.212.153]) by postgresql.org (Postfix) with SMTP id D0CCC9FB2FF for ; Fri, 9 Mar 2007 18:40:11 -0400 (AST) Received: (qmail 17489 invoked from network); 9 Mar 2007 22:40:10 -0000 X-NetworkBox-HamSign: 0101;OUT;wbeetaau1;e5999eccf5c44df66571005ec4a03152; Received: from mail.weatherbeeta.com.au (10.10.0.2) by network-box.weatherbeeta.com.au with SMTP; 9 Mar 2007 22:40:09 -0000 Received: (qmail 12345 invoked by uid 1166); 10 Mar 2007 09:40:09 +1100 Received: from 203.214.112.197 by mail.weatherbeeta.com.au (envelope-from , uid 1165) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.6/2315. perlscan: 1.25-st-qms. Clear:RC:0(203.214.112.197):. Processed in 0.436057 secs); 09 Mar 2007 22:40:09 -0000 X-Antivirus-mail.weatherbeeta.com.au-Mail-From: phillip.smith@weatherbeeta.com.au via mail.weatherbeeta.com.au X-Antivirus-mail.weatherbeeta.com.au: 1.25-st-qms (Clear:RC:0(203.214.112.197):. Processed in 0.436057 secs Process 12331) Received: from 203-214-112-197.dyn.iinet.net.au (HELO ?192.168.1.253?) (phillip.smith@weatherbeeta.com.au@203.214.112.197) by mail.weatherbeeta.com.au with SMTP; 10 Mar 2007 09:40:07 +1100 Subject: Re: [Re: PRIMARY KEY] From: Phillip Smith Reply-To: phillip.smith@weatherbeeta.com.au To: Bruno Wolff III Cc: pgsql-sql@postgresql.org In-Reply-To: <20070309150332.GC23704@wolff.to> References: <1173270012.4925.66.camel@phillip-desktop> <20070309150332.GC23704@wolff.to> Content-Type: multipart/alternative; boundary="=-1wX5B52GzOLAJVf1pO+J" Organization: Weatherbeeta P/L Date: Sat, 10 Mar 2007 09:44:49 +1100 Message-Id: <1173480289.4925.77.camel@phillip-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 X-Scanned-By-wbeetaau1: Virus scan performed by network-box X-Scanned-By-wbeetaau1: Scanner file id is wbeetaau1-1173480009.830-17480-000 X-Scanned-By-wbeetaau1: No known viruses found in message (received+scanned in 0.03/0.15 secs) X-Scanned-By-wbeetaau1: Spam-Check-Result: No, hits=0 required=7 tests= autolearn=no version=2.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.146 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO, HTML_30_40, HTML_MESSAGE X-Spam-Level: * X-Archive-Number: 200703/133 X-Sequence-Number: 27771 --=-1wX5B52GzOLAJVf1pO+J Content-Type: text/plain Content-Transfer-Encoding: 7bit Of course - my bad... That's the main reason I upgraded to 8.2! On Fri, 2007-03-09 at 09:03 -0600, Bruno Wolff III wrote: > On Wed, Mar 07, 2007 at 23:20:12 +1100, > Phillip Smith wrote: > > If you actually need to know the value of N_GEN in your ASP application, > > you will need to query the database first and select the NEXTVAL from > > the sequence that the "serial" data type will create, then use that > > returned value in your insert - ie, DON'T exclude it from the insert, > > otherwise it will default to NEXTVAL again and return a different value. > > In 8.2, you can also use the RETURNING clause to get those values. *******************Confidentiality and Privilege Notice******************* The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email. Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments --=-1wX5B52GzOLAJVf1pO+J Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Of course - my bad... That's the main reason I upgraded to 8.2!

On Fri, 2007-03-09 at 09:03 -0600, Bruno Wolff III wrote:
On Wed, Mar 07, 2007 at 23:20:12 +1100,
  Phillip Smith <fukawi2@iinet.net.au> wrote:
> If you actually need to know the value of N_GEN in your ASP application,
> you will need to query the database first and select the NEXTVAL from
> the sequence that the "serial" data type will create, then use that
> returned value in your insert - ie, DON'T exclude it from the insert,
> otherwise it will default to NEXTVAL again and return a different value.

In 8.2, you can also use the RETURNING clause to get those values.

*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email.

Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments
--=-1wX5B52GzOLAJVf1pO+J--