Re: Last ID Problem - Mailing list pgsql-novice

From
Subject Re: Last ID Problem
Date
Msg-id 20050209165318.44626.qmail@web52403.mail.yahoo.com
Whole thread Raw
In response to Re: Last ID Problem  (<operationsengineer1@yahoo.com>)
Responses Re: Last ID Problem
List pgsql-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

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Last ID Problem
Next
From: "Oisin Glynn"
Date:
Subject: Returning a long string (varchar from a function)