pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Phillip Smith <fukawi2@iinet.net.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: [Re: PRIMARY KEY]
Date: Fri, 9 Mar 2007 09:03:32 -0600
Message-ID: <20070309150332.GC23704@wolff.to> (raw)
In-Reply-To: <1173270012.4925.66.camel@phillip-desktop>
References: <1173270012.4925.66.camel@phillip-desktop>

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.



view thread (3+ messages)  latest in thread

Message-ID: <20070309150332.GC23704@wolff.to>
Permalink:  ../20070309150332.GC23704@wolff.to/
Also on:    postgresql.org/message-id/20070309150332.GC23704@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, fukawi2@iinet.net.au
  Subject: Re: [Re: PRIMARY KEY]
  In-Reply-To: <20070309150332.GC23704@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox