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

Re: Last ID Problem

From: <operationsengineer1(at)yahoo(dot)com>
To: operationsengineer1(at)yahoo(dot)com,Mitch Pirtle <mitch(dot)pirtle(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Last ID Problem
Date: 2005-02-09 16:53:18
Message-ID: 20050209165318.44626.qmail@web52403.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-novice
> another point of interest.  now that i've been
> refreshing my nextval() statement, my highest
> cust_id
> value is 65, but nextval() keeps incrementing from
> where it was before.  reading through the manual,
> this
> is designed in behavior.
> 
> it looks like i could reset the value using
> setval().
> 
> i also noticed that currval() returns the value of
> the
> last nextval().  this infers that i must call
> nextval() prior to being able to get currval(), yet
> nextval() was not included in the original
> suggestion.
> 
> am i missing something here?
> 
> tia...
> 

actually, michael fuhr addressed this issue in this
group on 1/31/05.  not sure why it didn't register.

so, i should use nextval() if i use mitch's
methodology of calling the id first then performing
the insert.

giving that nextval increments on a refresh, is there
anything i need to worry about?

or is the worst case scenario a gap in unique ids? 
this shouldn't matter as far as i can tell - as long
as the numbers are unique.

tia...


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

In response to

Responses

pgsql-novice by date

Next:From: Oisin GlynnDate: 2005-02-09 17:30:51
Subject: Returning a long string (varchar from a function)
Previous:From: Michael FuhrDate: 2005-02-09 16:52:56
Subject: Re: Last ID Problem

pgsql-hackers by date

Next:From: Michael FuhrDate: 2005-02-09 17:38:28
Subject: Re: Last ID Problem
Previous:From: Michael FuhrDate: 2005-02-09 16:52:56
Subject: Re: Last ID Problem

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