> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
>
> "Spiegelberg, Greg" <gspiegelberg@isodxsolutions.com> writes:
> > As you can see, it's only providing the key1 column and the
> sequence is
> > providing the value for the column with the constraint.
> How can this be
> > happening?
>
> Perhaps at some point you manually inserted an id value past the
> then-current sequence value?
I have to assume that though I don't see it anywhere in the logs and the
logs are turned up all the way. The database is continually being
dropped and recreated automatically. Why this doesn't happen every time
the same data is imported or more often is leaving me scratching my
head.
> No, you've misunderstood currval(). That gives the value
> most recently
> obtained by nextval() within your own session; it is not
> affected by any
> subsequent manipulation of the sequence.
Thanks. That does explain it. I had incorrectly assumed currval()
always returned what the real current value of the sequence.