The only answer I have been able to come to is that restarting the
postmaster will clear this all up.
this is actually not an option for me.
of course i can make myself a function which will check if pid exists, but it would generally be better if there was some way to fix the problem in postgresql itself.
a series of delete's from some specific place perhaps?
depesz