Skip site navigation (1) Skip section navigation (2)

Re: currval, lastval, nextvar?

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: currval, lastval, nextvar?
Date: 2009-04-23 16:17:39
Message-ID: 20090423161739.GA8570@tux (view raw or flat)
Thread:
Lists: pgsql-novice
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "A. Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> writes:
> > Yes. You don't need call nextval.
> 
> Well, you do, but the point is that the default expression for a
> serial column includes the nextval() call.  Look at the table with
> \d, eg
> 
> So if you do an insert that doesn't provide a value for that column,
> the nextval is done implicitly.

Right, i know.

You don't need call nextval _explicit_, okay?



Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2009-04-23 16:21:33
Subject: Re: currval, lastval, nextvar?
Previous:From: Tom LaneDate: 2009-04-23 16:07:08
Subject: Re: currval, lastval, nextvar?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group