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

Re: going crazy with serial type

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Darren Ferguson <darren(at)crystalballinc(dot)com>
Cc: Cindy <ctmoore(at)uci(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: going crazy with serial type
Date: 2002-01-31 21:21:54
Message-ID: 200201312121.g0VLLtA08512@saturn.janwieck.net (view raw or flat)
Thread:
Lists: pgsql-general
Darren Ferguson wrote:
> For some reason unknown to myself if you have not initiated a nextval in
> the same psql command line before calling currval then that is the error
> msg you will get.

    Slightly  wrong. This is the correct behaviour if you haven't
    called NEXTVAL in that session before.

    The reason is that the SQL standard  defines  CURRVAL  to  be
    last value returned by NEXTVAL "in this session".


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck(at)Yahoo(dot)com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


In response to

Responses

pgsql-general by date

Next:From: Stephan SzaboDate: 2002-01-31 21:22:33
Subject: Re: Function to Pivot data
Previous:From: Syd AlsobrookDate: 2002-01-31 21:21:25
Subject: System commands

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