> > See currval() and nextval().
>
> What if his PK isn't a sequence?
Moreover, currval() and nextval() won't guarantee that you always get the
most recently inserted sequence value, either, because each connection
can have a cache of sequence values to assign from. While the backend
guarantees that each sequence value will be UNIQUE there is no guarantee
that MY currval() or nextval() is actually based on the last sequence value
that ANYONE used.
In short, I think the answer to the original question is that there is no
reliable way to find out what the last record inserted was.
--
Mike Nolan