pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Hunter, Ray <rhunter@enterasys.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Sequences
Date: Mon, 11 Feb 2002 09:51:37 -0600
Message-ID: <20020211155137.GA4605@wolff.to> (raw)
In-Reply-To: <59358A738F45D51186A30008C74CE250E81378@slc-exc1.ctron.com>
References: <59358A738F45D51186A30008C74CE250E81378@slc-exc1.ctron.com>

On Mon, Feb 11, 2002 at 10:12:33AM -0500,
  "Hunter, Ray" <rhunter@enterasys.com> wrote:
> The only problem with this solution is that I have already incremented the
> sequence and need to use the current value?  Is there a way to assign the
> value to a variable and then use it in an insert statement?

You should be doing this in one transaction in which case currval should
work. If you aren't doing it in one transaction, then your application
will need to remember the current value.



view thread (19+ messages)  latest in thread

Message-ID: <20020211155137.GA4605@wolff.to>
Permalink:  ../20020211155137.GA4605@wolff.to/
Also on:    postgresql.org/message-id/20020211155137.GA4605@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, rhunter@enterasys.com
  Subject: Re: Sequences
  In-Reply-To: <20020211155137.GA4605@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